WordPress.org

Ready to get started?Download WordPress

Forums

CF Internal Link Shortcode
Debug Errors (2 posts)

  1. vidhill
    Member
    Posted 2 years ago #

    In Debug mode the plugin is throwing the following error:

    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.

    http://wordpress.org/extend/plugins/internal-link-shortcode/

  2. vidhill
    Member
    Posted 2 years ago #

    I have written a fix myself, at line 205

    instead of

    if (is_admin()) {
    	wp_enqueue_script('cfplsc_admin_js', trailingslashit(get_bloginfo('url')).'?cf_action=cfplsc_admin_js', array('jquery'));
    }

    (which would add the script on all admin pages)

    I added this:

    add_action("admin_print_scripts-post.php", 'cfplsc_load_admin_js' );
    
    	function cfplsc_load_admin_js() {
    		wp_enqueue_script('cfplsc_admin_js', trailingslashit(get_bloginfo('url')).'?cf_action=cfplsc_admin_js', array('jquery'));
    	}

    the script is only added to post.php admin pages

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.