Show Custom Taxonomy Inside Custom Menu

You have some messed up code. I have reformatted your code to code which actually works. The following solution allows you to give your Custom Post Type menu a menu name of what ever you want. Just change the label “menu_name”. POST TYPE // Create the news custom post type register_post_type(‘nwcm_news’, array( ‘labels’ => array( … Read more

Displaying Custom Post Types In “At A Glance” Meta Box

Here is the function that I use to display CPT in the “At a glance” widget add_action( ‘dashboard_glance_items’, ‘cpad_at_glance_content_table_end’ ); function cpad_at_glance_content_table_end() { $args = array( ‘public’ => true, ‘_builtin’ => false ); $output=”object”; $operator=”and”; $post_types = get_post_types( $args, $output, $operator ); foreach ( $post_types as $post_type ) { $num_posts = wp_count_posts( $post_type->name ); $num … Read more

WordPress dashboard, viewing CPT results in 504

The CPT and taxonomy terms are created via plugin. I was able to lessen the query by adding the following to my plugin: add_action( ‘pre_get_posts’, ‘nwtd_lpfs_custom_admin_query’ ); function nwtd_lpfs_custom_admin_query( $query ) { if( !is_admin() && !$query->is_main_query() ) { return; } if( is_post_type_archive( ‘services’ ) ) { $query->set(‘no_found_rows’, 1 ); $query->set(‘update_post_meta_cache’, 0 ); $query->set(‘update_post_term_cache’, 0 ); … Read more

Why not register shortcodes if is_admin dashboard?

I have observed the same issue with contact-form-7 a while back. But note that registering shortcodes based on is_admin is doing_it_wrong (see gmazzap`s answer) There are the two reasons that seem legitimate at first sight (and why they are wrong): (Unlikely) The plugin author tried to optimize the script to only register shortcodes when they … Read more

Move excerpt meta box to above content editor

It’s simple, just unregister postexcerpt box first then add another one on the top. Here is my code add_action( ‘admin_menu’, function () { remove_meta_box(‘postexcerpt’, ‘post’, ‘normal’); }, 999 ); add_action(‘edit_form_after_title’, ‘post_excerpt_meta_box’);

Add screen options to custom admin pages

You don’t need to invent a new screen option row. Just use proper metaboxes. Currently, you are drawing pseudo-metaboxes: <!– Post status start–> <div class = “postbox”> <div class = “handlediv”> <br> </div> <h3 class = “hndle”><span><?php _e(“By Post Status”, ‘bulk-delete’); ?></span></h3> <div class = “inside”> <h4><?php _e(“Select the posts which you want to delete”, … Read more