Skip to:
Content

BuddyPress.org

Changeset 8533


Ignore:
Timestamp:
06/16/2014 07:17:58 PM (5 years ago)
Author:
boonebgorges
Message:

Improved documentation for xprofile_insert_field()

See #5022

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r8336 r8533  
    105105}
    106106
     107/**
     108 * Insert an xprofile field.
     109 *
     110 * @param array $args {
     111 *     Array of arguments.
     112 *     @type int $field_id Optional. Pass the ID of an existing field to edit
     113 *           that field.
     114 *     @type int $field_group_id ID of the associated field group.
     115 *     @type int $parent_id Optional. ID of the parent field.
     116 *     @type string $type Field type. Checked against a field_types whitelist.
     117 *     @type string $name Name of the new field.
     118 *     @type string $description Optional. Descriptive text for the field.
     119 *     @type bool $is_required Optional. Whether users must provide a value for
     120 *           the field. Default: false.
     121 *     @type bool $can_delete Optional. Whether admins can delete this field in
     122 *           the Dashboard interface. Generally this is true only for the Name
     123 *           field, which is required throughout BP. Default: false.
     124 *     @type string $order_by Optional. For field types that support options
     125 *           (such as 'radio'), this flag determines whether the sort order of
     126 *           the options will be 'default' (order created) or 'custom'.
     127 *     @type bool $is_default_option Optional. For the 'option' field type,
     128 *           setting this value to true means that it'll be the default value
     129 *           for the parent field when the user has not yet overridden.
     130 *     @type int $option_order Optional. For the 'option' field type, this
     131 *           determines the order in which the options appear.
     132 * }
     133 * @return bool|int False on failure, ID of new field on success.
     134 */
    107135function xprofile_insert_field( $args = '' ) {
    108136    global $bp;
    109137
    110138    extract( $args );
    111 
    112     /**
    113      * Possible parameters (pass as assoc array):
    114      *  'field_id'
    115      *  'field_group_id'
    116      *  'parent_id'
    117      *  'type'
    118      *  'name'
    119      *  'description'
    120      *  'is_required'
    121      *  'can_delete'
    122      *  'field_order'
    123      *  'order_by'
    124      *  'is_default_option'
    125      *  'option_order'
    126      */
    127139
    128140    // Check we have the minimum details
Note: See TracChangeset for help on using the changeset viewer.