Created
July 26, 2015 15:34
-
-
Save dboutote/0d936510eab10e4ff418 to your computer and use it in GitHub Desktop.
Hide Links in page and post row actions (WordPress edit.php)
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 | |
/** | |
* Hide certain links from edit.php | |
* | |
* @param array $actions Array of action links | |
* @return array $actions Filtered array of links | |
*/ | |
function remove_row_actions( $actions ) { | |
if( isset($actions['view']) ) { | |
unset( $actions['view'] ); | |
} | |
if( isset($actions['trash']) ) { | |
unset( $actions['trash'] ); | |
} | |
if( isset($actions['inline hide-if-no-js']) ) { | |
unset( $actions['inline hide-if-no-js'] ); | |
} | |
return $actions; | |
} | |
add_action('post_row_actions', 'remove_row_actions'); | |
add_action('page_row_actions', 'remove_row_actions'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment