Created
August 9, 2014 16:59
-
-
Save hellofromtonya/5182a3d9b3cf5dbe88ec to your computer and use it in GitHub Desktop.
Add Number of Views to the WordPress Posts Listings' Columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('manage_page_posts_columns' , 'lunarwp_core\add_stats_column'); | |
add_filter('manage_post_posts_columns' , 'lunarwp_core\add_stats_column'); | |
/** | |
* Add Number of Views to the Post Listings' Columns | |
* | |
* @since 1.0.0 | |
* | |
* @param array $columns Post Listing Columns | |
* @return array Returns the amended columns array | |
*/ | |
function add_stats_column($columns) | |
{ | |
return \lunarwp_core\insert_array_into_associatve_array($columns, array('lunarwp_stats' => __('#Views', 'lunarwp')), 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment