Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/04/2014 11:18:22 AM (11 years ago)
Author:
djpaul
Message:

xProfile: fix regression in wp-admin field types screen where duplicate field templates were being shown for pre-2.0 custom field types.

A switch statement in the original xprofile_admin_field() was mis-read and an action was being triggered when it shouldn't have, causing the field templates to double up.
Fixes backwards compatibility with existing plugins that add custom field types.

Fixes #5511

File:
1 edited

Legend:

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

    r8178 r8232  
    384384
    385385            <?php
    386             $field_type = bp_xprofile_create_field_type( $field->type );
    387             $field_type->admin_field_html();
    388 
    389             do_action( 'xprofile_admin_field', $field, 1 );
     386            if ( in_array( $field->type, array_keys( bp_xprofile_get_field_types() ) ) ) {
     387                $field_type = bp_xprofile_create_field_type( $field->type );
     388                $field_type->admin_field_html();
     389
     390            } else {
     391                do_action( 'xprofile_admin_field', $field, 1 );
     392            }
    390393            ?>
    391394
Note: See TracChangeset for help on using the changeset viewer.