Changeset 976
- Timestamp:
- 11/12/2014 06:54:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/handbook.php
r952 r976 109 109 add_filter( 'user_has_cap', array( $this, 'grant_handbook_caps' ) ); 110 110 add_filter( 'init', array( $this, 'register_post_type' ) ); 111 add_action( 'admin_page_access_denied', array( $this, 'admin_page_access_denied' ) );112 111 add_filter( 'post_type_link', array( $this, 'post_type_link' ), 10, 2 ); 113 112 add_filter( 'pre_get_posts', array( $this, 'pre_get_posts' ) ); … … 191 190 } 192 191 193 function admin_page_access_denied() {194 if ( ! current_user_can( 'read' ) ) {195 wp_redirect( admin_url( "edit.php?post_type={$this->post_type}" ) );196 exit;197 }198 }199 200 192 function post_type_link( $link, $post ) { 201 193 if ( $post->post_type === $this->post_type && $post->post_name === $this->post_type ) {
Note: See TracChangeset
for help on using the changeset viewer.