WordPress.org

Making WordPress.org

Changeset 3661


Ignore:
Timestamp:
07/10/2016 12:32:05 AM (4 years ago)
Author:
drewapicture
Message:

developer.wordpress.org: Check if the user can edit an explanation before giving them an edit link in the Toolbar.

See #1534. See #1781.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/explanations.php

    r3609 r3661  
    252252        }
    253253
    254         if ( ! empty( $screen->post_type ) ) {
    255             // Proceed only if there's an explanation for the current reference post type.
    256             if ( $explanation = \DevHub\get_explanation( $screen ) ) {
     254        // Proceed only if there's an explanation for the current reference post type.
     255        if ( ! empty( $screen->post_type ) && $explanation = \DevHub\get_explanation( $screen ) ) {
     256
     257            // Must be able to edit the explanation.
     258            if ( is_user_member_of_blog() && current_user_can( 'edit_explanation', $explanation->ID ) ) {
    257259                $post_type = get_post_type_object( $this->exp_post_type );
    258260
Note: See TracChangeset for help on using the changeset viewer.