Making WordPress.org

Changeset 12894


Ignore:
Timestamp:
09/17/2023 10:02:49 PM (10 months ago)
Author:
Clorith
Message:

Support Forums: Adjust wp-admin capabilities.

The initial post type implementation did not properly declare which capabilities could see the admin UI. Although a limited part of the solution, it is nice for it to actually be accessible.

The capabilities used mirror bbPress', but does not use the bbPress functions to declare them, to avoid unintentional dependency confusion if bbPress ever changes its internal permission-generating functions in the future.

Follow up to [12892].

See #5715.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-report-topic.php

    r12892 r12894  
    302302                'description'       => __( 'User-submitted reports of support topics or reviews.', 'wporg-forums' ),
    303303                'public'            => false,
    304                 'show_ui'           => current_user_can( 'moderate' ),
     304                'show_ui'           => current_user_can( 'bbp_forums_admin' ),
    305305                'show_in_admin_bar' => false,
    306306                'show_in_rest'      => false,
    307307                'menu_icon'         => 'dashicons-flag',
    308                 'capability_type'   => 'moderate',
     308                'capability_type'   => array( 'forum', 'forums' ),
     309                'capabilities'      => array(
     310                    'edit_posts'          => 'edit_forums',
     311                    'edit_others_posts'   => 'edit_others_forums',
     312                    'publish_posts'       => 'publish_forums',
     313                    'read_private_posts'  => 'read_private_forums',
     314                    'read_hidden_posts'   => 'read_hidden_forums',
     315                    'delete_posts'        => 'delete_forums',
     316                    'delete_others_posts' => 'delete_others_forums'
     317                ),
    309318                'supports'          => array( 'editor' ),
    310319            )
Note: See TracChangeset for help on using the changeset viewer.