Skip to:
Content

BuddyPress.org

Changeset 10200


Ignore:
Timestamp:
10/07/2015 03:08:00 PM (11 years ago)
Author:
boonebgorges
Message:

Use xprofile_get_field() throughout bp-xprofile.

It's properly cached after [10198], so let's use it.

See #6638.

Location:
trunk/src/bp-xprofile
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-admin.php

    r10179 r10200  
    180180
    181181                                                                        // Load the field.
    182                                                                         $field = new BP_XProfile_Field( $field->id );
     182                                                                        $field = xprofile_get_field( $field->id );
    183183
    184184                                                                        $class = '';
     
    330330        $bp = buddypress();
    331331
    332         $field           = new BP_XProfile_Field( $field_id );
     332        $field           = xprofile_get_field( $field_id );
    333333        $field->group_id = $group_id;
    334334
     
    439439        // @todo trust this param.
    440440        $field_type  = ( 'field' == $field_type ) ? __( 'field', 'buddypress' ) : __( 'option', 'buddypress' );
    441         $field       = new BP_XProfile_Field( $field_id );
     441        $field       = xprofile_get_field( $field_id );
    442442
    443443        if ( !$field->delete( (bool) $delete_data ) ) {
  • trunk/src/bp-xprofile/bp-xprofile-filters.php

    r10163 r10200  
    252252 */
    253253function xprofile_filter_format_field_value_by_field_id( $field_value, $field_id ) {
    254         $field = new BP_XProfile_Field( $field_id );
     254        $field = xprofile_get_field( $field_id );
    255255        return xprofile_filter_format_field_value_by_type( $field_value, $field->type );
    256256}
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r10198 r10200  
    251251        // Instantiate a new field object.
    252252        if ( ! empty( $r['field_id'] ) ) {
    253                 $field = new BP_XProfile_Field( $r['field_id'] );
     253                $field = xprofile_get_field( $r['field_id'] );
    254254        } else {
    255255                $field = new BP_XProfile_Field;
     
    394394        }
    395395
    396         $field          = new BP_XProfile_Field( $field_id );
     396        $field          = xprofile_get_field( $field_id );
    397397        $field_type     = BP_XProfile_Field::get_type( $field_id );
    398398        $field_type_obj = bp_xprofile_create_field_type( $field_type );
     
    505505
    506506        // Use the user's stored level, unless custom visibility is disabled.
    507         $field = new BP_XProfile_Field( $field_id );
     507        $field = xprofile_get_field( $field_id );
    508508        if ( isset( $field->allow_custom_visibility ) && 'disabled' === $field->allow_custom_visibility ) {
    509509                $current_level = $field->default_visibility;
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r10179 r10200  
    811811                 */
    812812                if ( ! method_exists( $field, 'get_children' ) ) {
    813                         $field_obj = new BP_XProfile_Field( $field->id );
     813                        $field_obj = xprofile_get_field( $field->id );
    814814
    815815                        foreach ( $field as $field_prop => $field_prop_value ) {
Note: See TracChangeset for help on using the changeset viewer.