$text"; break; default: break; } } // count total featured post function a_rcp_total_featured() { $result = new WP_Query(array( 'post_type' => 'post', 'post_status' => 'publish', 'meta_query' => array( array( 'key' => '_is_featured', 'value' => 'yes' ) ) , 'posts_per_page' => 1 )); wp_reset_postdata(); wp_reset_query(); $totalFeaturedPosts = $result->found_posts; unset($result); return $totalFeaturedPosts; } function adl_rec_post_current_screen($screen) { if (defined('DOING_AJAX') && DOING_AJAX) { return $screen; } add_filter('views_edit-post', 'adl_rpost_featured_post_counts_display'); return $screen; } // show featured post counts on admin screen post screen function adl_rpost_featured_post_counts_display($views) { $post_type = ((isset($_GET['post_type']) && $_GET['post_type'] != "") ? $_GET['post_type'] : 'post'); $count = a_rcp_total_featured($post_type); $views['featured_post'] = "

Published Featured Posts ({$count})

"; return $views; } function adl_rec_post_admin_head() { $apsAjaxLoader = A_RCP_PLUGIN_URI .'/css/ajax-loader.gif'; ?> $post_id, 'featured_status' => $toggleStatus, 'total_featured' => a_rcp_total_featured() )); die(); } } add_action('wp_ajax_toggle_featured_post', 'toggle_featured_post');