[buddypress-trac] [BuddyPress Trac] #5472: xprofile_insert_field -> type - 'option' not allowed?

buddypress-trac noreply at wordpress.org
Sat Jun 14 18:00:42 UTC 2014

#5472: xprofile_insert_field -> type - 'option' not allowed?
 Reporter:  shanebp       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.1
Component:  XProfile      |     Version:  1.9.2
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |

Comment (by boonebgorges):

 Thanks, DJPaul. Only tricky bit is that we now define our `field_types`
 whitelist by looking at the registered `BP_XProfile_Field_Type` classes. I
 don't think it makes sense to have one of these for 'option', since it's
 not really a field type. 5472.01.patch seems like a reasonable place to
 make the manual modification to the whitelist. An alternative is to change
 the relevant check in `xprofile_insert_field()` to

 if ( !in_array( $type, (array) $bp->profile->field_types ) && 'option' !==
 $type )

 This latter technique is more conservative, but it might also fail to
 address other edge cases for programatically creating fields. DJPaul, I'd
 like your feedback on this before going forward.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5472#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list