Skip to:
Content

BuddyPress.org

Changeset 11700


Ignore:
Timestamp:
09/27/2017 08:19:02 AM (7 years ago)
Author:
djpaul
Message:

xprofile: add before/after actions around when a BP_XProfile_Field instance gets deleted (the data, not the object).

For consistency with BP_XProfile_Group and BP_XProfile_ProfileData.

Fixes #7600

Props mechter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r11468 r11700  
    345345        }
    346346
     347        /**
     348         * Fires before the current field instance gets deleted.
     349         *
     350         * @since 3.0.0
     351         *
     352         * @param BP_XProfile_Field $this Current instance of the field being deleted. Passed by reference.
     353         */
     354        do_action_ref_array( 'xprofile_field_before_delete', array( &$this ) );
     355
    347356        $bp  = buddypress();
    348357        $sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_fields} WHERE id = %d OR parent_id = %d", $this->id, $this->id );
     
    356365            BP_XProfile_ProfileData::delete_for_field( $this->id );
    357366        }
     367
     368        /**
     369         * Fires after the current field instance gets deleted.
     370         *
     371         * @since 3.0.0
     372         *
     373         * @param BP_XProfile_Field $this Current instance of the field being deleted. Passed by reference.
     374         */
     375        do_action_ref_array( 'xprofile_field_after_delete', array( &$this ) );
    358376
    359377        return true;
Note: See TracChangeset for help on using the changeset viewer.