Created
November 29, 2013 19:09
-
-
Save ptasker/7710508 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
| <?php | |
| function pre_exclude_pages_from_admin($query) { | |
| if ( ! is_admin() ) | |
| return $query; | |
| global $pagenow, $post_type; | |
| if ( !current_user_can( 'administrator' ) && is_admin() && $pagenow == 'edit.php' && $post_type == 'page' ) { | |
| $query->query_vars['post__not_in'] = array( '10', '167', '205' ); // Enter your page IDs here | |
| } | |
| } | |
| add_filter( 'parse_query', 'pre_exclude_pages_from_admin' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment