Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/03/2016 06:14:41 AM (8 years ago)
Author:
tw2113
Message:

More cleanup and new phpdocs for functions or methods in the XProfile component.

See #6406.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r10418 r10434  
    1111defined( 'ABSPATH' ) || exit;
    1212
     13/**
     14 * Class to help set up XProfile fields.
     15 */
    1316class BP_XProfile_Field {
    1417
     
    1720     *
    1821     * @since 1.0.0
    19      *
    2022     * @var int ID of field.
    2123     */
     
    2628     *
    2729     * @since 1.0.0
    28      *
    2930     * @var int Field group ID for field.
    3031     */
     
    3536     *
    3637     * @since 1.0.0
    37      *
    3838     * @var int Parent ID of field.
    3939     */
     
    4444     *
    4545     * @since 1.0.0
    46      *
    4746     * @var string Field type.
    4847     */
     
    5352     *
    5453     * @since 1.0.0
    55      *
    5654     * @var string Field name.
    5755     */
     
    6260     *
    6361     * @since 1.0.0
    64      *
    6562     * @var string Field description.
    6663     */
     
    7168     *
    7269     * @since 1.0.0
    73      *
    7470     * @var bool Is field required to be filled out?
    7571     */
     
    8076     *
    8177     * @since 1.0.0
    82      *
    8378     * @var int Can field be deleted?
    8479     */
     
    8984     *
    9085     * @since 1.0.0
    91      *
    9286     * @var int Field position.
    9387     */
     
    9892     *
    9993     * @since 1.0.0
    100      *
    10194     * @var int Option order.
    10295     */
     
    107100     *
    108101     * @since 1.0.0
    109      *
    110102     * @var string Order child fields by.
    111103     */
     
    116108     *
    117109     * @since 1.0.0
    118      *
    119110     * @var bool Is this the default option for this field?
    120111     */
     
    126117     * @since 1.9.0
    127118     * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_default_visibility()`.
    128      *
    129119     * @var string Default field data visibility.
    130120     */
     
    136126     * @since 2.3.0
    137127     * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_allow_custom_visibility()`.
    138      *
    139128     * @var string Members are allowed/disallowed to modify data visibility.
    140129     */
     
    145134     *
    146135     * @since 2.0.0
    147      *
    148136     * @var BP_XProfile_Field_Type Field type object used for validation.
    149137     */
     
    154142     *
    155143     * @since 2.0.0
    156      *
    157144     * @var BP_XProfile_ProfileData Field data for user ID.
    158145     */
     
    323310     *
    324311     * @param boolean $delete_data Whether or not to delete data.
    325      *
    326312     * @return boolean
    327313     */
     
    486472            do_action_ref_array( 'xprofile_field_after_save', array( $this ) );
    487473
    488             // Recreate type_obj in case someone changed $this->type via a filter
     474            // Recreate type_obj in case someone changed $this->type via a filter.
    489475            $this->type_obj            = bp_xprofile_create_field_type( $this->type );
    490476            $this->type_obj->field_obj = $this;
     
    502488     *
    503489     * @param int $user_id ID of the user to get field data for.
    504      *
    505490     * @return object
    506491     */
     
    517502     *
    518503     * @param bool $for_editing Whether or not the field is for editing.
    519      *
    520504     * @return array
    521505     */
     
    639623     * @param bool  $append       Whether to append to existing member types. If false, all existing member type
    640624     *                            associations will be deleted before adding your `$member_types`. Default false.
    641      *
    642625     * @return array Member types for the current field, after being saved.
    643626     */
     
    810793    }
    811794
    812     /** Static Methods ********************************************************/
    813 
     795    /* Static Methods ********************************************************/
     796
     797    /**
     798     * Get the type for provided field ID.
     799     *
     800     * @param int $field_id Field ID to get type of.
     801     * @return bool|null|string
     802     */
    814803    public static function get_type( $field_id = 0 ) {
    815804        global $wpdb;
     
    840829     *
    841830     * @param int $group_id ID of the field group to delete fields from.
    842      *
    843831     * @return boolean
    844832     */
     
    871859     *
    872860     * @param string $field_name Name of the field to query the ID for.
    873      *
    874861     * @return boolean
    875862     */
     
    898885     * @param int|null $position       Field position to update.
    899886     * @param int|null $field_group_id ID of the field group.
    900      *
    901887     * @return boolean
    902888     */
     
    934920     * @param string|array $member_types Member type or array of member types. Use 'any' to return unrestricted
    935921     *                                   fields (those available for anyone, regardless of member type).
    936      *
    937922     * @return array Multi-dimensional array, with field IDs as top-level keys, and arrays of member types
    938923     *               associated with each field as values.
     
    10751060
    10761061    /**
    1077      * This function populates the items for radio buttons checkboxes and drop
    1078      * down boxes.
     1062     * Populates the items for radio buttons, checkboxes, and dropdown boxes.
    10791063     */
    10801064    public function render_admin_form_children() {
     
    14891473     *
    14901474     * @param int $field_id ID of field to check.
    1491      *
    14921475     * @return bool
    14931476     */
Note: See TracChangeset for help on using the changeset viewer.