WordPress.org

Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (2 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php

    r5867 r6287  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory;
     3
    34use WordPressdotorg\Plugin_Directory\Tools;
    45
     
    2324    public static function map_meta_cap( $required_caps, $cap, $user_id, $context ) {
    2425        $plugin_edit_cap = false;
    25         switch( $cap ) {
     26        switch ( $cap ) {
    2627            case 'plugin_admin_edit':
    2728            case 'plugin_add_committer':
     
    3031            case 'plugin_remove_support_rep':
    3132                $plugin_edit_cap = true;
     33
    3234                // Fall through
    33 
    34             // Although we no longer have a admin view, this capability is still used to determine if the current user is a committer/contributor.
     35                // Although we no longer have a admin view, this capability is still used to determine if the current user is a committer/contributor.
    3536            case 'plugin_admin_view':
    3637                // Committers + Contributors.
    3738                // If no committers, post_author.
    3839                $required_caps = array();
    39                 $post = get_post( $context[0] );
     40                $post          = get_post( $context[0] );
    4041
    4142                if ( ! $post ) {
     
    9899     */
    99100    public static function add_roles() {
    100 
    101101        $reviewer = array(
    102102            'read'                    => true,
     
    121121        // Remove the roles first, incase we've changed the permission set.
    122122        remove_role( 'plugin_reviewer' );
    123         remove_role( 'plugin_admin'    );
    124         add_role( 'plugin_reviewer',  'Plugin Reviewer', $reviewer );
    125         add_role( 'plugin_admin',     'Plugin Admin',    $admin    );
     123        remove_role( 'plugin_admin' );
     124        add_role( 'plugin_reviewer', 'Plugin Reviewer', $reviewer );
     125        add_role( 'plugin_admin', 'Plugin Admin', $admin );
    126126
    127127        $wp_admin_role = get_role( 'administrator' );
     
    135135    }
    136136}
    137 
Note: See TracChangeset for help on using the changeset viewer.