[buddypress-trac] [BuddyPress Trac] #5916: Action xprofile_field_after_save has no way of knowing field_id for newly created field

buddypress-trac noreply at wordpress.org
Mon Sep 29 15:04:21 UTC 2014


#5916: Action xprofile_field_after_save has no way of knowing field_id for newly
created field
-------------------------+------------------
 Reporter:  tometzky     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.2
Component:  XProfile     |     Version:  2.1
 Severity:  minor        |  Resolution:
 Keywords:  2nd-opinion  |
-------------------------+------------------
Changes (by boonebgorges):

 * keywords:   => 2nd-opinion
 * milestone:  Awaiting Review => 2.2


Comment:

 Yes, this is a good suggestion in the abstract, though we should probably
 do it differently.

 The most natural thing to do would be to modify the current object, so
 that you could get the info you need out of the `$this` currently passed
 to the filter. (We'd update the `id` as well as the children that we
 create at https://buddypress.trac.wordpress.org/browser/tags/2.1/src/bp-
 xprofile/bp-xprofile-classes.php#L744.) However, this might pose backward
 compatibility issues with plugins that are doing something like checking
 `empty( $field->id )` to identify this as a newly created field. Do other
 devs have thoughts about this?

 Less elegant, but less problematic option: `do_action_ref_array(
 'xprofile_field_after_save', array( $this, $new_field_id, $children_ids )
 );`

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5916#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list