Making WordPress.org

Changeset 976


Ignore:
Timestamp:
11/12/2014 06:54:56 PM (10 years ago)
Author:
coffee2code
Message:

Handbook plugin: remove admin redirect causing redirect loop for users with insufficient privileges. Fixes #725

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/handbook.php

    r952 r976  
    109109        add_filter( 'user_has_cap',                       array( $this, 'grant_handbook_caps' ) );
    110110        add_filter( 'init',                               array( $this, 'register_post_type' ) );
    111         add_action( 'admin_page_access_denied',           array( $this, 'admin_page_access_denied' ) );
    112111        add_filter( 'post_type_link',                     array( $this, 'post_type_link' ), 10, 2 );
    113112        add_filter( 'pre_get_posts',                      array( $this, 'pre_get_posts' ) );
     
    191190    }
    192191
    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 
    200192    function post_type_link( $link, $post ) {
    201193        if ( $post->post_type === $this->post_type && $post->post_name === $this->post_type ) {
Note: See TracChangeset for help on using the changeset viewer.