Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/24/2011 10:22:55 PM (15 years ago)
Author:
boonebgorges
Message:

Introduces wrapper functions for retrieving and checking items in bp->action_variables. action_variables audit for xprofile component. See #3325

File:
1 edited

Legend:

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

    r4827 r4840  
    3737
    3838    // Make sure a group is set.
    39     if ( empty( $bp->action_variables[1] ) )
    40         bp_core_redirect( $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/1' );
     39    if ( !bp_action_variable( 1 ) )
     40        bp_core_redirect( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/1' );
    4141
    4242    // Check the field group exists
    43     if ( ( !empty( $bp->action_variables[0] ) && 'group' != $bp->action_variables[0] ) || !xprofile_get_field_group( $bp->action_variables[1] ) ) {
     43    if ( !bp_is_action_variable( 'group' ) || !xprofile_get_field_group( bp_action_variable( 1 ) ) ) {
    4444        bp_do_404();
    4545        return;
     
    5454        // Check we have field ID's
    5555        if ( empty( $_POST['field_ids'] ) )
    56             bp_core_redirect( trailingslashit( $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . $bp->action_variables[1] ) );
     56            bp_core_redirect( trailingslashit( $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) );
    5757
    5858        // Explode the posted field IDs into an array so we know which
     
    6868                if ( !empty( $_POST['field_' . $field_id . '_day'] ) && is_numeric( $_POST['field_' . $field_id . '_day'] ) ) {
    6969                    // Concatenate the values
    70                     $date_value =   $_POST['field_' . $field_id . '_day'] . ' ' .
    71                                     $_POST['field_' . $field_id . '_month'] . ' ' .
    72                                     $_POST['field_' . $field_id . '_year'];
     70                    $date_value =   $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year'];
    7371
    7472                    // Turn the concatenated value into a timestamp
     
    116114
    117115            // Redirect back to the edit screen to display the updates and message
    118             bp_core_redirect( trailingslashit( $bp->displayed_user->domain . $bp->profile->slug . '/edit/group/' . $bp->action_variables[1] ) );
     116            bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) );
    119117        }
    120118    }
     
    137135        return false;
    138136
    139     if ( !empty( $bp->action_variables ) ) {
     137    if ( bp_action_variables() ) {
    140138        bp_do_404();
    141139        return;
Note: See TracChangeset for help on using the changeset viewer.