Making WordPress.org


Ignore:
Timestamp:
12/01/2014 07:58:50 PM (12 years ago)
Author:
johnjamesjacoby
Message:

BuddyPress.org: Update codex capability and trusted user check to allow admins to manage page terms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/functions-codex.php

    r1012 r1013  
    443443    public function map_meta_caps( $caps = array(), $cap = '', $user_id = 0 ) {
    444444
    445         // Should we bail
    446         if ( $this->bail() ) {
    447             return $caps;
    448         }
    449 
    450445        // What cap are we switching
    451446        switch ( $cap ) {
     
    455450            case 'delete_page'  :
    456451            case 'delete_codex_tags' :
    457                 $caps = array( 'do_not_allow' );
     452                if ( ! $this->is_user_trusted() ) {
     453                    $caps = array( 'do_not_allow' );
     454                }
    458455                break;
    459456
     
    462459            case 'assign_codex_tags' :
    463460            case 'manage_codex_tags' :
    464                 $caps = array( 'editor' );
     461                $caps = array( 'manage_categories' );
    465462                break;
    466463        }
     
    483480
    484481        // Should we bail
    485         if ( $this->bail() ) {
     482        if ( $this->is_user_trusted() ) {
    486483            return;
    487484        }
     
    525522
    526523    /**
    527      * Checks if no further action needs to be taken
     524     * Checks if user is trusted in the codex
    528525     *
    529526     * @author jjj
     
    531528     * @return boolean True if should bail, false if should proceed
    532529     */
    533     private function bail() {
     530    private function is_user_trusted() {
    534531
    535532        // Bail if user is an admin
     
    547544}
    548545new Codex_Hacks();
    549 
Note: See TracChangeset for help on using the changeset viewer.