[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-xprofile/classes/ -> class-bp-xprofile-field.php (summary)

BuddyPress XProfile Classes.

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

Defines 1 class

BP_XProfile_Field:: (39 methods):
  __construct()
  populate()
  get_instance()
  fill_data()
  __get()
  __isset()
  delete()
  save()
  get_field_data()
  get_children()
  delete_children()
  get_member_types()
  set_member_types()
  get_member_type_label()
  get_default_visibility()
  get_allow_custom_visibility()
  get_signup_position()
  get_do_autolink()
  get_type()
  delete_for_group()
  get_id_from_name()
  update_position()
  get_fields_for_member_type()
  admin_validate()
  admin_save_settings()
  render_admin_form_children()
  render_admin_form()
  get_field_type_supports()
  field_type_supports()
  submit_metabox()
  name_and_description()
  member_type_metabox()
  visibility_metabox()
  required_metabox()
  autolink_metabox()
  type_metabox()
  signup_position_metabox()
  default_field_hidden_inputs()
  is_default_field()


Class: BP_XProfile_Field  - X-Ref

Class to help set up XProfile fields.

__construct( $id = null, $user_id = null, $get_data = true )   X-Ref
Initialize and/or populate profile field.

param: int|null $id Field ID.
param: int|null $user_id User ID.
param: bool     $get_data Get data.
since: 1.1.0

populate( $id, $user_id = null, $get_data = true )   X-Ref
Populate a profile field object.

param: int      $id Field ID.
param: int|null $user_id User ID.
param: bool     $get_data Get data.
since: 1.1.0

get_instance( $field_id, $user_id = null, $get_data = true )   X-Ref
Retrieve a `BP_XProfile_Field` instance.

param: int      $field_id ID of the field.
param: int|null $user_id  Optional. ID of the user associated with the field.
param: bool     $get_data Whether to fetch data for the specified `$user_id`.
since: 2.4.0
since: 2.8.0 Added `$user_id` and `$get_data` parameters.
return: BP_XProfile_Field|false Field object if found, otherwise false.

fill_data( $args )   X-Ref
Fill object vars based on data passed to the method.

param: array|object $args Array or object representing the `BP_XProfile_Field` properties.
since: 2.4.0

__get( $key )   X-Ref
Magic getter.

param: string $key Property name.
since: 2.4.0
return: string|null

__isset( $key )   X-Ref
Magic issetter.

param: string $key Property name.
since: 2.4.0
return: bool

delete( $delete_data = false )   X-Ref
Delete a profile field.

param: boolean $delete_data Whether or not to delete data.
since: 1.1.0
return: boolean

save()   X-Ref
Save a profile field.

since: 1.1.0
return: boolean

get_field_data( $user_id = 0 )   X-Ref
Get field data for a user ID.

param: int $user_id ID of the user to get field data for.
since: 1.2.0
return: BP_XProfile_ProfileData

get_children( $for_editing = false )   X-Ref
Get all child fields for this field ID.

param: bool $for_editing Whether or not the field is for editing. Default to false.
since: 1.2.0
return: array

delete_children()   X-Ref
Delete all field children for this field.

since: 1.2.0

get_member_types()   X-Ref
Gets the member types to which this field should be available.

Will not return inactive member types, even if associated metadata is found.

'null' is a special pseudo-type, which represents users that do not have a member type.

since: 2.4.0
return: array Array of member type names.

set_member_types( $member_types, $append = false )   X-Ref
Sets the member types for this field.

param: array $member_types Array of member types. Can include 'null' (users with no type) in addition to any
param: bool  $append       Whether to append to existing member types. If false, all existing member type
since: 2.4.0
return: array Member types for the current field, after being saved.

get_member_type_label()   X-Ref
Gets a label representing the field's member types.

This label is displayed alongside the field's name on the Profile Fields Dashboard panel.

since: 2.4.0
return: string

get_default_visibility()   X-Ref
Get the field's default visibility setting.

Lazy-loaded to reduce overhead.

Defaults to 'public' if no visibility setting is found in the database.

since: 2.4.0
return: string

get_allow_custom_visibility()   X-Ref
Get whether the field's default visibility can be overridden by users.

Lazy-loaded to reduce overhead.

Defaults to 'allowed'.

since: 4.4.0
return: string 'disabled' or 'allowed'.

get_signup_position()   X-Ref
Get the field's signup position.

since: 8.0.0
return: int the field's signup position.

get_do_autolink()   X-Ref
Get whether the field values should be auto-linked to a directory search.

Lazy-loaded to reduce overhead.

Defaults to true for multi and default fields, false for single fields.

since: 2.5.0
return: bool

get_type( $field_id = 0 )   X-Ref
Get the type for provided field ID.

param: int $field_id Field ID to get type of.
return: bool|null|string

delete_for_group( $group_id = 0 )   X-Ref
Delete all fields in a field group.

param: int $group_id ID of the field group to delete fields from.
since: 1.2.0
return: boolean

get_id_from_name( $field_name = '' )   X-Ref
Get field ID from field name.

param: string $field_name Name of the field to query the ID for.
since: 1.5.0
return: int|null Field ID on success; null on failure.

update_position( $field_id, $position = null, $field_group_id = null )   X-Ref
Update field position and/or field group when relocating.

param: int      $field_id       ID of the field to update.
param: int|null $position       Field position to update.
param: int|null $field_group_id ID of the field group.
since: 1.5.0
return: boolean

get_fields_for_member_type( $member_types )   X-Ref
Gets the IDs of fields applicable for a given member type or array of member types.

param: string|array $member_types Member type or array of member types. Use 'any' to return unrestricted
since: 2.4.0
return: array Multi-dimensional array, with field IDs as top-level keys, and arrays of member types

admin_validate()   X-Ref
Validate form field data on submission.

since: 2.2.0
return: boolean

admin_save_settings( $settings )   X-Ref
Save miscellaneous settings for this field.

Some field types have type-specific settings, which are saved here.

param: array $settings Array of settings.
since: 2.7.0

render_admin_form_children()   X-Ref
Populates the items for radio buttons, checkboxes, and dropdown boxes.


render_admin_form( $message = '' )   X-Ref
Oupput the admin form for this field.

param: string $message Message to display.
since: 1.9.0

get_field_type_supports()   X-Ref
Gets field type supports.

since: 8.0.0
return: bool[] Supported features.

field_type_supports( $support = '' )   X-Ref
Checks whether the field type supports the requested feature.

param: string $support The name of the feature.
since: 8.0.0
return: boolean True if the field type supports the feature. False otherwise.

submit_metabox( $button_text = '' )   X-Ref
Private method used to display the submit metabox.

param: string $button_text Text to put on button.
since: 2.3.0

name_and_description()   X-Ref
Private method used to output field name and description fields.

since: 2.3.0

member_type_metabox()   X-Ref
Private method used to output field Member Type metabox.

since: 2.4.0
return: void If default field or if the field does not support the feature.

visibility_metabox()   X-Ref
Private method used to output field visibility metaboxes.

since: 2.3.0
return: void If default field or if the field does not support the feature.

required_metabox()   X-Ref
Output the metabox for setting if field is required or not.

since: 2.3.0
return: void If default field or if the field does not support the feature.

autolink_metabox()   X-Ref
Private method used to output autolink metabox.

since: 2.5.0
return: void If the field does not support the feature.

type_metabox()   X-Ref
Output the metabox for setting what type of field this is.

since: 2.3.0
return: void If default field.

signup_position_metabox()   X-Ref
Output the metabox for setting the field's position into the signup form.

since: 8.0.0
return: void If default field or if the field does not support the feature.

default_field_hidden_inputs()   X-Ref
Output hidden fields used by default field.

since: 2.3.0
return: void If not default field.

is_default_field( $field_id = 0 )   X-Ref
Return if a field ID is the default field.

param: int $field_id ID of field to check.
since: 2.3.0
return: bool



Generated: Sun Dec 22 01:00:54 2024 Cross-referenced by PHPXref 0.7.1