[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

BuddyPress XProfile Classes.

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

Defines 1 class

BP_XProfile_Field:: (35 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_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()
  submit_metabox()
  name_and_description()
  member_type_metabox()
  visibility_metabox()
  required_metabox()
  autolink_metabox()
  type_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.

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

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

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

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.
since: 2.4.0
since: 2.8.0 Added `$user_id` and `$get_data` parameters.
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`.

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

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

__get( $key )   X-Ref
Magic getter.

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

__isset( $key )   X-Ref
Magic issetter.

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

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

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

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
since: 1.2.0
param: int $user_id ID of the user to get field data for.

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

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

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.
since: 2.4.0
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

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_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
since: 1.2.0
param: int $group_id ID of the field group to delete fields from.

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

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

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

return: boolean
since: 1.5.0
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.

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
since: 2.4.0
param: string|array $member_types Member type or array of member types. Use 'any' to return unrestricted

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

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.

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

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.

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

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

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

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

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

return: void If default field id 1.
since: 2.3.0

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

return: void If default field.
since: 2.3.0

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

return: void If default field id 1.
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

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
since: 2.3.0
param: int $field_id ID of field to check.



Generated: Sat Dec 14 01:01:40 2019 Cross-referenced by PHPXref 0.7.1