Add link on the top menu of the post table?

They are filtered via the views_[screen-id] filter. The screen-id of the edit post page is edit-post, so you can modify the links like this: add_action( ‘views_edit-post’, ‘wpse17484_views_edit_post’ ); function wpse17484_views_edit_post( $views ) { $views[‘wpse17484’] = ‘<a href=”https://wordpress.stackexchange.com/questions/17484/my-url”>My action</a>’; return $views; } You can see the code that generates the post views in WP_Posts_List_Table::get_views().

Popular posts by view with Jetpack

There is a Jetpack widget called Top Posts and Pages (Jetpack) If you check out the [source code][2] for this widget, you can see that it’s using the function stats_get_csv() to retrieve the stats: $post_view_posts = stats_get_csv( ‘postviews’, array( ‘days’ => 2, ‘limit’ => 10 ) ); If you want to generate your custom most … Read more

Writing a view count with w3 total cache

This won’t work if page caching is enabled, I would recommend creating an ajax request which calls this function instead. e.g. add_action( “wp_ajax_nopriv_view_count”, ‘view_count’ ); add_action( “wp_ajax_view_count”, ‘view_count’ ); function view_count(){ update_post_meta($_GET[‘id’], ‘view_count’, $count++); } (then create an ajax call in JS which passes through the page id to this counting function) Ajax shouldn’t be … Read more

WP Admin default view mode for Custom Post Type

To change the mode URL variable but in the load try this: add_action( ‘load-edit.php’, ‘my_default_posts_list_mode’ ); function my_default_posts_list_mode() { $post_type = isset( $_GET[‘post_type’] ) ? $_GET[‘post_type’] : ”; if ( $post_type && $post_type == ‘my_post_type’ && !isset( $_REQUEST[‘mode’] ) ) $_REQUEST[‘mode’] = ‘excerpt’; } Got the “insipration” from here: Set Default Listing “View” in Admin

Creating a custom MCE view for your shortcodes [closed]

I had a lot of trouble finding information and examples of this, so here you go: https://github.com/dtbaker/wordpress-mce-view-and-shortcode-editor This converts a [shortcode] into a nice custom view to match the frontend, and adds an edit button for easy shortcode editing. <?php /** * Class dtbaker_Shortcode_Banner * handles the creation of [boutique_banner] shortcode * adds a button … Read more