[ Index ]

PHP Cross Reference of BuddyPress




/src/bp-xprofile/ -> bp-xprofile-filters.php (summary)

BuddyPress XProfile Filters. Apply WordPress defined filters.

File Size: 769 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 21 functions


Functions that are not part of a class:

bp_xprofile_sanitize_field_options( $field_options = '' )   X-Ref
Sanitize each field option name for saving to the database.

return: mixed
since: 2.3.0
param: mixed $field_options Options to sanitize.

bp_xprofile_sanitize_field_default( $field_default = '' )   X-Ref
Sanitize each field option default for saving to the database.

return: array|int
since: 2.3.0
param: mixed $field_default Field defaults to sanitize.

xprofile_filter_kses( $content, $data_obj = null, $field_id = null )   X-Ref
Run profile field values through kses with filterable allowed tags.

return: string $content
since: 1.5.0
since: 2.1.0 Added `$data_obj` parameter.
since: 5.0.0 Added `$field_id` parameter.
param: string                       $content  Content to filter.
param: BP_XProfile_ProfileData|null $data_obj Optional. The BP_XProfile_ProfileData object.
param: int|null                     $field_id Optional. The ID of the profile field.

xprofile_sanitize_data_value_before_display( $value, $type, $field_id )   X-Ref
Filters profile field values for allowed HTML.

since: 5.0.0
param: string $value    Field value.
param: string $type     Field type.
param: int    $field_id Field ID.

xprofile_sanitize_data_value_before_display_from_get_field_data( $value, $field_id )   X-Ref
Filters profile field values for allowed HTML, when coming from xprofile_get_field_data().

since: 5.0.0
param: string $value    Field value.
param: int    $field_id Field ID.

xprofile_sanitize_data_value_before_save( $field_value, $field_id = 0, $reserialize = true, $data_obj = null )   X-Ref
Safely runs profile field data through kses and force_balance_tags.

return: string
since: 1.2.6
param: string      $field_value Field value being sanitized.
param: int         $field_id    Field ID being sanitized.
param: bool        $reserialize Whether to reserialize arrays before returning. Defaults to true.
param: object|null $data_obj    The BP_XProfile_ProfileData object.

xprofile_filter_format_field_value( $field_value, $field_type = '' )   X-Ref
Runs stripslashes on XProfile fields.

return: false|string $field_value Filtered XProfile field_value. False on failure.
since: 1.0.0
param: string $field_value XProfile field_value to be filtered.
param: string $field_type  XProfile field_type to be filtered.

xprofile_filter_format_field_value_by_type( $field_value, $field_type = '', $field_id = '' )   X-Ref
Apply display_filter() filters as defined by BP_XProfile_Field_Type classes, when inside a bp_has_profile() loop.

return: mixed
since: 2.1.0
since: 2.4.0 Added `$field_id` parameter.
param: mixed      $field_value Field value.
param: string     $field_type  Field type.
param: string|int $field_id    Optional. ID of the field.

xprofile_filter_format_field_value_by_field_id( $field_value, $field_id )   X-Ref
Apply display_filter() filters as defined by the BP_XProfile_Field_Type classes, when fetched
by xprofile_get_field_data().

return: string
since: 2.1.0
param: mixed $field_value Field value.
param: int   $field_id    Field type.

xprofile_filter_pre_validate_value_by_field_type( $value, $field, $field_type_obj )   X-Ref
Apply pre_validate_filter() filters as defined by the BP_XProfile_Field_Type classes before validating.

return: mixed
since: 2.1.0
param: mixed                  $value          Value passed to the bp_xprofile_set_field_data_pre_validate filter.
param: BP_XProfile_Field      $field          Field object.
param: BP_XProfile_Field_Type $field_type_obj Field type object.

bp_xprofile_escape_field_data( $value, $field_type, $field_id )   X-Ref
Escape field value for display.

Most field values are simply run through esc_html(). Those that support rich text (by default, `textarea` only)
are sanitized using kses, which allows HTML tags from a controlled list.

return: string
since: 2.4.0
param: string $value      Field value.
param: string $field_type Field type.
param: int    $field_id   Field ID.

xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' )   X-Ref
Filter an Extended Profile field value, and attempt to make clickable links
to members search results out of them.

- Not run on datebox field types.
- Not run on values without commas with less than 5 words.
- URL's are made clickable.

To disable globally:
remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 3 );

To disable for a single field, use the 'Autolink' settings in Dashboard > Users > Profile Fields.

return: string|array
since: 1.1.0
param: string $field_value Profile field data value.
param: string $field_type  Profile field type.

xprofile_filter_comments( $comments, $post_id = 0 )   X-Ref
Ensures that BP data appears in comments array.

This filter loops through the comments return by a normal WordPress request
and swaps out user data with BP xprofile data, where available.

return: array $comments
since: 1.2.0
param: array $comments Comments to filter in.
param: int   $post_id  Post ID the comments are for.

bp_xprofile_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql = '' )   X-Ref
Filter BP_User_Query::populate_extras to override each queries users fullname.

since: 1.7.0
param: BP_User_Query $user_query   User query to filter.
param: string        $user_ids_sql SQL statement to use.

bp_xprofile_add_xprofile_query_to_user_query( BP_User_Query $q )   X-Ref
Parse 'xprofile_query' argument passed to BP_User_Query.

since: 2.2.0
param: BP_User_Query $q User query object.

bp_xprofile_filter_meta_query( $q )   X-Ref
Filter meta queries to modify for the xprofile data schema.

return: string
since: 2.0.0
param: string $q SQL query.

bp_xprofile_register_personal_data_exporter( $exporters )   X-Ref
Register XProfile personal data exporter.

return: array An array of personal data exporters.
since: 4.0.0
since: 5.0.0 adds an `exporter_bp_friendly_name` param to exporters.
param: array $exporters  An array of personal data exporters.

bp_get_the_profile_signup_field_input_name( $field_selector = '' )   X-Ref
Used to edit the field input name inside the xProfile Admin Screen

return: string                The text to use as the input name/id attribute.
since: 8.0.0
param: string $field_selector The text to use as the input name/id attribute.

_bp_xprofile_signup_do_backcompat( $args = array()   X-Ref
Provides Signup fields argument back compatibility for template overrides.

return: array The xProfile loop's signup arguments.
since: 8.0.0
param: array $args The xProfile loop's signup arguments.

_bp_xprofile_signup_check_backcompat( $template = '', $template_name = '' )   X-Ref
Checks whether back compatibility is needed about xProfile loop's signup arguments.

since: 8.0.0
param: string $template      The located path for registration template.
param: string $template_name The needed template name.

_bp_xprofile_signup_start_backcompat()   X-Ref
Starts Signup fields back compatibility process only on the signup's page.

since: 8.0.0

Generated: Mon May 20 01:01:04 2024 Cross-referenced by PHPXref 0.7.1