Created
April 19, 2016 17:54
-
-
Save dboutote/037104d5e961c59e17a38e308835c3f5 to your computer and use it in GitHub Desktop.
[WordPress] Hide status link in the Posts table
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
<?php | |
function _dbdb_wp_count_posts( $counts, $type, $perm ) { | |
global $pagenow; | |
if( 'edit.php' !== $pagenow ){ | |
return $counts; | |
} | |
if( current_user_can( 'manage_options' ) ){ | |
return $counts; | |
} | |
$_counts = new stdClass(); | |
foreach ( $counts as $status => $count ){ | |
$_counts->$status = ''; | |
} | |
return $_counts; | |
} | |
add_filter('wp_count_posts', '_dbdb_wp_count_posts', 99, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment