• Resolved xedemx

    (@xedemx)


    Hi Richard,

    Great plugin, thank you!

    I have noticed this error when installing it to vegafuszeray.hu:

    Notice: Undefined variable: version in /home/vegafuszeray/public_html/wp-content/plugins/cookie-law-info/php/functions.php on line 137

    I’ve fixed it by adding $version = ‘1.5.3’; after the if block. (See below)

    Sorry if this is a repost, I haven’t seen this error posted in the forum.

    Cheers,
    Adam

    function cookielawinfo_enqueue_frontend_scripts() {
    $the_options = cookielawinfo_get_admin_settings();
    if ( $the_options[‘is_on’] == true ) {

    /**
    * Force reload
    */
    $version = ‘1.5.3’;

    wp_register_style( ‘cookielawinfo-style’, CLI_PLUGIN_URL . ‘css/cli-style.css’, null, $version );
    wp_enqueue_style( ‘cookielawinfo-style’ );

    wp_enqueue_script( ‘cookie-law-info-script’, CLI_PLUGIN_URL . ‘js/cookielawinfo.js’, array( ‘jquery’ ), $version );
    }
    $version = ‘1.5.3’;
    wp_register_style( ‘cookielawinfo-table-style’, CLI_PLUGIN_URL . ‘css/cli-tables.css’, null, $version );
    }

    https://ww.wp.xz.cn/plugins/cookie-law-info/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, thanks for spotting. The correct fix is very slightly different (rather than duplicate a variable declaration, just move it above the if statement) and I’ll push that in a minor release. Cheers!

    Thread Starter xedemx

    (@xedemx)

    You’re right 🙂 thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Undefined variable: version’ is closed to new replies.