Last active
December 19, 2015 21:39
-
-
Save WerdsWords/6021322 to your computer and use it in GitHub Desktop.
#5: post_row_actions
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 | |
/** | |
* Disable Quick Edit row action for posts | |
* | |
* @see WP_Posts_List_Table::single_row() | |
* | |
* @param array $actions An array of row actions, keys corresponding to the span class attribute of each element. | |
* @param object $post The post object. | |
* | |
* @return array The row actions array. | |
*/ | |
function wpdocs_no_posts_quickedit( $actions, $post ) { | |
// If the post_type is 'post', and the Quick Edit row action is set | |
if ( 'post' == $post->post_type && isset( $actions['inline hide-if-no-js'] ) ) | |
unset( $actions['inline hide-if-no-js'] ); | |
return $actions; | |
} | |
add_filter( 'post_row_actions', 'wpdocs_no_posts_quickedit', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://fotd.werdswords.com/post_row_actions/