Skip to:
Content

BuddyPress.org

Changeset 5799


Ignore:
Timestamp:
02/16/2012 10:36:14 PM (8 years ago)
Author:
djpaul
Message:

Don't allow direct url access to new activity caps file. See #4015

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-caps.php

    r5797 r5799  
    77 * @since 1.6
    88 */
     9
     10// Exit if accessed directly
     11if ( ! defined( 'ABSPATH' ) ) exit;
    912
    1013/**
     
    2730        case 'bp_xprofile_change_field_visibility' :
    2831            $caps = array( 'read' );
    29            
     32
    3033            // You may pass args manually: $field_id, $profile_user_id
    31             $field_id   = isset( $args[0] ) ? (int)$args[0] : bp_get_the_profile_field_id();
     34            $field_id       = isset( $args[0] ) ? (int)$args[0] : bp_get_the_profile_field_id();
    3235            $profile_user_id = isset( $args[1] ) ? (int)$args[1] : bp_displayed_user_id();
    33            
     36
    3437            // Visibility on the fullname field is not editable
    3538            if ( 1 == $field_id ) {
     
    3740                break;
    3841            }
    39            
     42
    4043            // Has the admin disabled visibility modification for this field?
    4144            if ( 'disabled' == bp_xprofile_get_meta( $field_id, 'field', 'allow_custom_visibility' ) ) {
     
    5356            break;
    5457    }
    55    
     58
    5659    return apply_filters( 'bp_xprofile_map_meta_caps', $caps, $cap, $user_id, $args );
    5760}
    5861add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 );
    59 
    6062?>
Note: See TracChangeset for help on using the changeset viewer.