Adding an Options Page to a Plugin

@AndrettiMilas, If you really need a top level menu item (which is not encouraged), you should use add_submenu_pageinstead of add_options_page. Please refer to the Codex for the required parameters. You could add the submenu like: add_submenu_page( ‘wlseo’, ‘Submenu 1’, ‘Submenu 1’, ‘manage_options’, ‘wlseo-submenu-1’);

How to make a slideshow shortcode based on the WordPress gallery shortcode? [closed]

I would do something similar to this: return ‘<div class=”slideshow”>’.do_shortcode( ‘.'”]’ ).'</div>’; In other words, wrap around the existing short code instead of ending up with a frankenstein version of it. You can then use the slideshow div to select against using jquery and whichever javascript gallery you want to use. How you would do … Read more

After plugin options changed hook

Use the action update_option_{$option}, where $option is the same as the second argument for register_setting(). This hook fires after the option has been updated. add_filter( ‘update_option_directory’, ‘run_after_change’, 10, 2 ); function run_after_change( $old_value, $new_value ) { // compare both values and do something } 10 is the priority, 2 the number of accepted arguments for … Read more

Edit default comments page in WP Admin

The comments are displayed using an instance of the WP_Comments_List_Table class which is defined as the global variable $wp_list_table. You could extend this class and then use any action after $wp_list_table is defined (admin_head-edit-comments.php would work) to create an instance of your own class, copy all properties of $wp_list_table to the instance of your class … Read more

How can I create a custom shortcode that will return a custom post type by ID?

Ok, I found a simple answer to my problem. This is the shortcode function I ended up using to get my desired result: function cpt_case_study_func($atts){ extract( shortcode_atts( array( ‘id’ => null, ), $atts ) ); $post = get_post($id); $content=”<div class=”case-study”><h3>” . $post->post_title . ‘</h3> <p>’ . $post->post_content . ‘</p></div>’; return $content; } add_shortcode(‘case_study’,’cpt_case_study_func’); Thanks to … Read more

Remove ALL css for a specific plugin page

You can try this function. function remove_all_theme_styles() { global $wp_styles; $wp_styles->queue = array(); } add_action(‘wp_print_styles’, ‘remove_all_theme_styles’, 100); This should work on any theme, but its not really a good approach to disable theme css just to make your plugin look good.