bp_get_the_profile_field_datebox
Filters the output for the profile field datebox.
Description
apply_filters( 'bp_get_the_profile_field_datebox', (string) $html, (string) $args_type, (string) $day, (string) $month, (string) $year, (int) $this_field_obj_id, (string) $date );
Parameters (7)
- 0. $html (string)
- HTML output for the field.
- 1. $args_type (string)
- Which date type is being rendered for.
- 2. $day (string)
- Date formatted for the current day.
- 3. $month (string)
- Date formatted for the current month.
- 4. $year (string)
- Date formatted for the current year.
- 5. $this_field_obj_id (int)
- ID of the field object being rendered.
- 6. $date (string)
- Current date.
Usage
- To run the hook, copy the example below.
- $html = apply_filters( 'bp_get_the_profile_field_datebox', $html, $args_type, $day, $month, $year, $this_field_obj_id, $date );
- if ( !empty( $html ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_get_the_profile_field_datebox callback
- function filter_bp_get_the_profile_field_datebox( $html, $args_type, $day, $month, $year, $this_field_obj_id, $date ) {
- // make filter magic happen here...
- return $html;
- };
- // add the filter
- add_filter( 'bp_get_the_profile_field_datebox', 'filter_bp_get_the_profile_field_datebox', 10, 7 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'bp_get_the_profile_field_datebox', 'filter_bp_get_the_profile_field_datebox', 10, 7 );
Defined (1)
The filter is defined in the following location(s).
- /bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php
- echo apply_filters( 'bp_get_the_profile_field_datebox', $html, $args['type'], $day, $month, $year, $this->field_obj->id, $date );