Quantcast
Viewing all articles
Browse latest Browse all 31591

maccast on "[Plugin: RSSImport] wp_enqueue_script was called incorrectly"

I'm getting this warning when WP_DEBUG is on:

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. Please see Debugging in WordPress for more information.

The error is in reference to line 601 of the rssimport.php file.

Basically the stuff in this block

if ( is_admin() && FB_RSSI_QUICKTAG ) {
	if ( version_compare( $GLOBALS['wp_version'], '3.3alpha', '>=' ) ) {
		$post_page_pages = array('post-new.php', 'post.php', 'page-new.php', 'page.php');
		if ( in_array( $pagenow, $post_page_pages ) ) {
			wp_enqueue_script(
				'rssimport_insert_button',
				plugin_dir_url( __FILE__) . '/js/quicktag.js',
				array( 'quicktags' )
			);
			add_action( 'admin_print_scripts', 'rssimport_insert_button' );
		}
	} else {
		add_action( 'admin_footer', 'RSSImport_insert_button' );
	}
}

http://wordpress.org/plugins/rss-import/


Viewing all articles
Browse latest Browse all 31591

Trending Articles