How do I adapt this solution to work with my plugin? (Please see the link).
I enqueue my css and js script as follows:
function my_plugin_init() {
wp_enqueue_script('my_plugin_script', plugins_url('js/the_filepath.js', __FILE__), array('jquery'));
wp_enqueue_style( 'my_plugin_css', plugins_url( '/css/the_filepath.css', __FILE__ ) );
}
add_action('init', 'my_plugin_init');
I tried putting this in the theme's functions.php, but it didn't work:
function remove_my_plugin_extras() {
remove_action('init', 'my_plugin_init');
}
if( !is_page('My_Page') ) {
add_action('wp_head', 'remove_my_plugin_extras');
}
The script and css still loaded. How do I adapt the solution in this case?
add_*_page()call to add your settings page? – Chip Bennett Jan 24 '12 at 17:17