Skip to content

Instantly share code, notes, and snippets.

@dboutote
Created July 26, 2015 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dboutote/0d936510eab10e4ff418 to your computer and use it in GitHub Desktop.
Save dboutote/0d936510eab10e4ff418 to your computer and use it in GitHub Desktop.
Hide Links in page and post row actions (WordPress edit.php)
<?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