Support » Plugin: External Media without Import » Just some Notices with debug true

  • Resolved another-webmaster

    (@another-webmaster)


    I changed/added following in external-media-without-import.php because of the nasty notices.
    Removed the code between namespace emwi; and the first add_action lines
    and added following code to get rid of those nasty notices:

    
    function loading_scripts($hook)
    {
        $js_ver  = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . '/external-media-without-import.js' ));
        $css_ver = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . '/external-media-without-import.css' ));
    
        wp_enqueue_script( 'emwi-js', plugins_url( '/external-media-without-import.js', __FILE__ ), array(), $js_ver );
        wp_register_style( 'emwi-css', plugins_url( '/external-media-without-import.css', __FILE__ ), false, $css_ver );
        wp_enqueue_style( 'emwi-css' ); 
    }
    add_action('wp_enqueue_scripts', 'loading_scripts');
    

    Hope it helps somebody.

Viewing 2 replies - 1 through 2 (of 2 total)
  • unfortunately even your solution generated an error message:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'loading_scripts' not found or invalid function name in [my physical path]/wp-includes/class-wp-hook.php on line 286

    I tried to move the function in my functions.php, and assign an arbitrary value to $js_ver and $css_ver. error messages seem to be gone away, but the plugin didn’t work properly.

    Plugin Author zzxiang

    (@zzxiang)

    The debug warnings are fixed in version 1.1.1. Hope it also help @lucaboccianti solve the problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Just some Notices with debug true’ is closed to new replies.