[ Index ] |
PHP Cross Reference of BuddyPress |
[Source view] [Print] [Project Stats]
BuddyPress XProfile Classes.
File Size: | 1880 lines (54 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
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. return: BP_XProfile_Field|false Field object if found, otherwise false. 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. |
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. return: string|null param: string $key Property name. since: 2.4.0 |
__isset( $key ) X-Ref |
Magic issetter. return: bool param: string $key Property name. since: 2.4.0 |
delete( $delete_data = false ) X-Ref |
Delete a profile field. return: boolean param: boolean $delete_data Whether or not to delete data. since: 1.1.0 |
save() X-Ref |
Save a profile field. return: boolean since: 1.1.0 |
get_field_data( $user_id = 0 ) X-Ref |
Get field data for a user ID. return: BP_XProfile_ProfileData param: int $user_id ID of the user to get field data for. since: 1.2.0 |
get_children( $for_editing = false ) X-Ref |
Get all child fields for this field ID. return: array param: bool $for_editing Whether or not the field is for editing. Default to false. since: 1.2.0 |
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. return: array Array of member type names. since: 2.4.0 |
set_member_types( $member_types, $append = false ) X-Ref |
Sets the member types for this field. return: array Member types for the current field, after being saved. 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 |
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. return: string since: 2.4.0 |
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. return: string since: 2.4.0 |
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'. return: string 'disabled' or 'allowed'. since: 4.4.0 |
get_signup_position() X-Ref |
Get the field's signup position. return: int the field's signup position. since: 8.0.0 |
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. return: bool since: 2.5.0 |
get_type( $field_id = 0 ) X-Ref |
Get the type for provided field ID. return: bool|null|string param: int $field_id Field ID to get type of. |
delete_for_group( $group_id = 0 ) X-Ref |
Delete all fields in a field group. return: boolean param: int $group_id ID of the field group to delete fields from. since: 1.2.0 |
get_id_from_name( $field_name = '' ) X-Ref |
Get field ID from field name. return: int|null Field ID on success; null on failure. param: string $field_name Name of the field to query the ID for. since: 1.5.0 |
update_position( $field_id, $position = null, $field_group_id = null ) X-Ref |
Update field position and/or field group when relocating. return: boolean 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 |
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. return: array Multi-dimensional array, with field IDs as top-level keys, and arrays of member types param: string|array $member_types Member type or array of member types. Use 'any' to return unrestricted since: 2.4.0 |
admin_validate() X-Ref |
Validate form field data on submission. return: boolean since: 2.2.0 |
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. return: bool[] Supported features. since: 8.0.0 |
field_type_supports( $support = '' ) X-Ref |
Checks whether the field type supports the requested feature. return: boolean True if the field type supports the feature. False otherwise. param: string $support The name of the feature. since: 8.0.0 |
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. return: void If default field or if the field does not support the feature. since: 2.4.0 |
visibility_metabox() X-Ref |
Private method used to output field visibility metaboxes. return: void If default field or if the field does not support the feature. since: 2.3.0 |
required_metabox() X-Ref |
Output the metabox for setting if field is required or not. return: void If default field or if the field does not support the feature. since: 2.3.0 |
autolink_metabox() X-Ref |
Private method used to output autolink metabox. return: void If the field does not support the feature. since: 2.5.0 |
type_metabox() X-Ref |
Output the metabox for setting what type of field this is. return: void If default field. since: 2.3.0 |
signup_position_metabox() X-Ref |
Output the metabox for setting the field's position into the signup form. return: void If default field or if the field does not support the feature. since: 8.0.0 |
default_field_hidden_inputs() X-Ref |
Output hidden fields used by default field. return: void If not default field. since: 2.3.0 |
is_default_field( $field_id = 0 ) X-Ref |
Return if a field ID is the default field. return: bool param: int $field_id ID of field to check. since: 2.3.0 |
Generated: Thu Nov 21 01:00:57 2024 | Cross-referenced by PHPXref 0.7.1 |