Last active
November 13, 2015 14:14
-
-
Save bhwebworks/9d3a8d110dcb96638234 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Execute late to catch 'clone' and 'new draft' (Duplicate Post plugin) | |
add_filter( 'post_row_actions', 'bhww_core_remove_quick_edit_options', 100, 2 ); | |
add_filter( 'page_row_actions', 'bhww_core_remove_quick_edit_options', 100, 2 ); | |
function bhww_core_remove_quick_edit_options( $actions, $post ) { | |
if ( current_user_can( 'update_core' ) ) | |
return $actions; | |
global $post; | |
$protected_value = get_post_meta( $post->ID, 'protected_value', true ); | |
if ( 'Protected' == $protected_value ) { | |
unset( $actions['inline hide-if-no-js'], $actions['trash'], $actions['edit'], $actions['clone'], $actions['edit_as_new_draft'] ); | |
return $actions; | |
} else { | |
return $actions; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment