Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/03/2016 06:14:41 AM (9 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/bp-xprofile-template.php

    r10417 r10434  
    165165    }
    166166
     167    /**
     168     * Whether or not the loop has field groups.
     169     *
     170     * @return bool
     171     */
    167172    public function has_groups() {
    168173        if ( ! empty( $this->group_count ) ) {
     
    173178    }
    174179
     180    /**
     181     * Increments to the next group of fields.
     182     *
     183     * @return object
     184     */
    175185    public function next_group() {
    176186        $this->current_group++;
     
    196206    }
    197207
     208    /**
     209     * Rewinds to the start of the groups list.
     210     */
    198211    public function rewind_groups() {
    199212        $this->current_group = -1;
     
    203216    }
    204217
     218    /**
     219     * Kicks off the profile groups.
     220     *
     221     * @return bool
     222     */
    205223    public function profile_groups() {
    206224        if ( $this->current_group + 1 < $this->group_count ) {
     
    223241    }
    224242
     243    /**
     244     * Sets up the profile group.
     245     */
    225246    public function the_profile_group() {
    226247        global $group;
     
    243264    /** Fields ****************************************************************/
    244265
     266    /**
     267     * Increments to the next field.
     268     *
     269     * @return int
     270     */
    245271    public function next_field() {
    246272        $this->current_field++;
     
    251277    }
    252278
     279    /**
     280     * Rewinds to the start of the fields.
     281     */
    253282    public function rewind_fields() {
    254283        $this->current_field = -1;
     
    258287    }
    259288
     289    /**
     290     * Whether or not the loop has fields.
     291     *
     292     * @return bool
     293     */
    260294    public function has_fields() {
    261295        $has_data = false;
     
    272306    }
    273307
     308    /**
     309     * Kick off the profile fields.
     310     *
     311     * @return bool
     312     */
    274313    public function profile_fields() {
    275314        if ( $this->current_field + 1 < $this->field_count ) {
     
    283322    }
    284323
     324    /**
     325     * Set up the profile fields.
     326     */
    285327    public function the_profile_field() {
    286328        global $field;
     
    369411}
    370412
     413/**
     414 * Start off the profile groups.
     415 *
     416 * @return mixed
     417 */
    371418function bp_profile_groups() {
    372419    global $profile_template;
     
    374421}
    375422
     423/**
     424 * Set up the profile groups.
     425 *
     426 * @return mixed
     427 */
    376428function bp_the_profile_group() {
    377429    global $profile_template;
     
    379431}
    380432
     433/**
     434 * Whether or not the group has fields to display.
     435 *
     436 * @return mixed
     437 */
    381438function bp_profile_group_has_fields() {
    382439    global $profile_template;
     
    384441}
    385442
     443/**
     444 * Output the class attribute for a field.
     445 *
     446 * @param string|bool $class Extra classes to append to class attribute.
     447 */
    386448function bp_field_css_class( $class = false ) {
    387449    echo bp_get_field_css_class( $class );
    388450}
     451
     452    /**
     453     * Return the class attribute for a field.
     454     *
     455     * @param string|bool $class Extra classes to append to class attribute.
     456     * @return string
     457     */
    389458    function bp_get_field_css_class( $class = false ) {
    390459        global $profile_template;
     
    437506    }
    438507
     508/**
     509 * Whether or not the XProfile field has data to display.
     510 *
     511 * @return mixed
     512 */
    439513function bp_field_has_data() {
    440514    global $profile_template;
     
    442516}
    443517
     518/**
     519 * Whether or not the XProfile field has public data to display.
     520 *
     521 * @return bool
     522 */
    444523function bp_field_has_public_data() {
    445524    global $profile_template;
     
    452531}
    453532
     533/**
     534 * Output the XProfile group ID.
     535 */
    454536function bp_the_profile_group_id() {
    455537    echo bp_get_the_profile_group_id();
    456538}
     539
     540    /**
     541     * Return the XProfile group ID.
     542     *
     543     * @return mixed|void
     544     */
    457545    function bp_get_the_profile_group_id() {
    458546        global $group;
    459547
    460548        /**
    461          * Filters the profile group ID.
     549         * Filters the XProfile group ID.
    462550         *
    463551         * @since 1.1.0
     
    468556    }
    469557
     558/**
     559 * Output the XProfile group name.
     560 */
    470561function bp_the_profile_group_name() {
    471562    echo bp_get_the_profile_group_name();
    472563}
     564
     565    /**
     566     * Return the XProfile group name.
     567     *
     568     * @return mixed|void
     569     */
    473570    function bp_get_the_profile_group_name() {
    474571        global $group;
    475572
    476573        /**
    477          * Filters the profile group name.
     574         * Filters the XProfile group name.
    478575         *
    479576         * @since 1.0.0
     
    484581    }
    485582
     583/**
     584 * Output the XProfile group slug.
     585 */
    486586function bp_the_profile_group_slug() {
    487587    echo bp_get_the_profile_group_slug();
    488588}
     589
     590    /**
     591     * Return the XProfile group slug.
     592     *
     593     * @return mixed|void
     594     */
    489595    function bp_get_the_profile_group_slug() {
    490596        global $group;
    491597
    492598        /**
    493          * Filters the profile group slug.
     599         * Filters the XProfile group slug.
    494600         *
    495601         * @since 1.1.0
     
    500606    }
    501607
     608/**
     609 * Output the XProfile group description.
     610 */
    502611function bp_the_profile_group_description() {
    503612    echo bp_get_the_profile_group_description();
    504613}
     614
     615    /**
     616     * Return the XProfile group description.
     617     *
     618     * @return mixed|void
     619     */
    505620    function bp_get_the_profile_group_description() {
    506621        global $group;
    507622
    508623        /**
    509          * Filters the profile group description.
     624         * Filters the XProfile group description.
    510625         *
    511626         * @since 1.0.0
     
    516631    }
    517632
     633/**
     634 * Output the XProfile group edit form action.
     635 */
    518636function bp_the_profile_group_edit_form_action() {
    519637    echo bp_get_the_profile_group_edit_form_action();
    520638}
     639
     640    /**
     641     * Return the XProfile group edit form action.
     642     *
     643     * @return mixed|void
     644     */
    521645    function bp_get_the_profile_group_edit_form_action() {
    522646        global $group;
     
    526650
    527651        /**
    528          * Filters the action for the profile group edit form.
     652         * Filters the action for the XProfile group edit form.
    529653         *
    530654         * @since 1.1.0
     
    536660    }
    537661
     662/**
     663 * Output the XProfile group field IDs.
     664 */
    538665function bp_the_profile_group_field_ids() {
    539666    echo bp_get_the_profile_group_field_ids();
    540667}
     668
     669    /**
     670     * Return the XProfile group field IDs.
     671     *
     672     * @return string
     673     */
    541674    function bp_get_the_profile_group_field_ids() {
    542675        global $group;
     
    590723    }
    591724
     725/**
     726 * Return the XProfile fields.
     727 *
     728 * @return mixed
     729 */
    592730function bp_profile_fields() {
    593731    global $profile_template;
     
    595733}
    596734
     735/**
     736 * Sets up the XProfile field.
     737 *
     738 * @return mixed
     739 */
    597740function bp_the_profile_field() {
    598741    global $profile_template;
     
    600743}
    601744
     745/**
     746 * Output the XProfile field ID.
     747 */
    602748function bp_the_profile_field_id() {
    603749    echo bp_get_the_profile_field_id();
    604750}
     751
     752    /**
     753     * Return the XProfile field ID.
     754     * @return mixed|void
     755     */
    605756    function bp_get_the_profile_field_id() {
    606757        global $field;
    607758
    608759        /**
    609          * Filters the profile field ID.
     760         * Filters the XProfile field ID.
    610761         *
    611762         * @since 1.1.0
     
    616767    }
    617768
     769/**
     770 * Outputs the XProfile field name.
     771 */
    618772function bp_the_profile_field_name() {
    619773    echo bp_get_the_profile_field_name();
    620774}
     775
     776    /**
     777     * Returns the XProfile field name.
     778     *
     779     * @return mixed|void
     780     */
    621781    function bp_get_the_profile_field_name() {
    622782        global $field;
    623783
    624784        /**
    625          * Filters the profile field name.
     785         * Filters the XProfile field name.
    626786         *
    627787         * @since 1.0.0
     
    632792    }
    633793
     794/**
     795 * Outputs the XProfile field value.
     796 */
    634797function bp_the_profile_field_value() {
    635798    echo bp_get_the_profile_field_value();
    636799}
     800
     801    /**
     802     * Returns the XProfile field value.
     803     *
     804     * @return mixed|void
     805     */
    637806    function bp_get_the_profile_field_value() {
    638807        global $field;
     
    641810
    642811        /**
    643          * Filters the profile field value.
     812         * Filters the XProfile field value.
    644813         *
    645814         * @since 1.0.0
     
    652821    }
    653822
     823/**
     824 * Outputs the XProfile field edit value.
     825 */
    654826function bp_the_profile_field_edit_value() {
    655827    echo bp_get_the_profile_field_edit_value();
    656828}
     829
     830    /**
     831     * Returns the XProfile field edit value.
     832     *
     833     * @return mixed|void
     834     */
    657835    function bp_get_the_profile_field_edit_value() {
    658836        global $field;
     
    681859
    682860        /**
    683          * Filters the profile field edit value.
     861         * Filters the XProfile field edit value.
    684862         *
    685863         * @since 1.1.0
     
    692870    }
    693871
     872/**
     873 * Outputs the XProfile field type.
     874 */
    694875function bp_the_profile_field_type() {
    695876    echo bp_get_the_profile_field_type();
    696877}
     878
     879    /**
     880     * Returns the XProfile field type.
     881     *
     882     * @return mixed|void
     883     */
    697884    function bp_get_the_profile_field_type() {
    698885        global $field;
    699886
    700887        /**
    701          * Filters the profile field type.
     888         * Filters the XProfile field type.
    702889         *
    703890         * @since 1.1.0
     
    708895    }
    709896
     897/**
     898 * Outputs the XProfile field description.
     899 */
    710900function bp_the_profile_field_description() {
    711901    echo bp_get_the_profile_field_description();
    712902}
     903
     904    /**
     905     * Returns the XProfile field description.
     906     *
     907     * @return mixed|void
     908     */
    713909    function bp_get_the_profile_field_description() {
    714910        global $field;
    715911
    716912        /**
    717          * Filters the profile field description.
     913         * Filters the XProfile field description.
    718914         *
    719915         * @since 1.1.0
     
    724920    }
    725921
     922/**
     923 * Outputs the XProfile field input name.
     924 */
    726925function bp_the_profile_field_input_name() {
    727926    echo bp_get_the_profile_field_input_name();
    728927}
     928
     929    /**
     930     * Retursn the XProfile field input name.
     931     *
     932     * @return mixed|void
     933     */
    729934    function bp_get_the_profile_field_input_name() {
    730935        global $field;
     
    8211026    }
    8221027
     1028/**
     1029 * Render whether or not a profile field is required.
     1030 */
    8231031function bp_the_profile_field_is_required() {
    8241032    echo bp_get_the_profile_field_is_required();
    8251033}
     1034
     1035    /**
     1036     * Return whether or not a profile field is required.
     1037     * @return mixed|void
     1038     */
    8261039    function bp_get_the_profile_field_is_required() {
    8271040        global $field;
     
    8441057
    8451058/**
    846  * Echo the visibility level of this field.
     1059 * Output the visibility level of this field.
    8471060 */
    8481061function bp_the_profile_field_visibility_level() {
    8491062    echo bp_get_the_profile_field_visibility_level();
    8501063}
     1064
    8511065    /**
    8521066     * Return the visibility level of this field.
     1067     *
     1068     * @return mixed|void
    8531069     */
    8541070    function bp_get_the_profile_field_visibility_level() {
     
    8801096    echo bp_get_the_profile_field_visibility_level_label();
    8811097}
     1098
    8821099    /**
    8831100     * Return the visibility level label of this field.
     1101     *
     1102     * @return mixed|void
    8841103     */
    8851104    function bp_get_the_profile_field_visibility_level_label() {
     
    9071126    }
    9081127
    909 
     1128/**
     1129 * Return unserialized profile field data.
     1130 *
     1131 * @param string $value Content to maybe unserialize.
     1132 * @return mixed|string
     1133 */
    9101134function bp_unserialize_profile_field( $value ) {
    9111135    if ( is_serialized($value) ) {
     
    9181142}
    9191143
     1144/**
     1145 * Output XProfile field data.
     1146 *
     1147 * @param string|array $args Array of arguments for field data.
     1148 */
    9201149function bp_profile_field_data( $args = '' ) {
    9211150    echo bp_get_profile_field_data( $args );
    9221151}
     1152
     1153    /**
     1154     * Return XProfile field data.
     1155     *
     1156     * @param string|array $args Array of arguments for field data.
     1157     * @return mixed|void
     1158     */
    9231159    function bp_get_profile_field_data( $args = '' ) {
    9241160
     
    10541290}
    10551291
     1292/**
     1293 * Output the XProfile group name.
     1294 *
     1295 * @param bool $deprecated Deprecated boolean parameter.
     1296 * @return mixed|void
     1297 */
    10561298function bp_profile_group_name( $deprecated = true ) {
    10571299    if ( !$deprecated ) {
     
    10611303    }
    10621304}
     1305
     1306    /**
     1307     * Return the XProfile group name.
     1308     *
     1309     * @return mixed|void
     1310     */
    10631311    function bp_get_profile_group_name() {
    10641312
     
    10821330    }
    10831331
     1332/**
     1333 * Render a formatted string displaying when a profile was last updated.
     1334 */
    10841335function bp_profile_last_updated() {
    10851336
     
    10921343    }
    10931344}
     1345
     1346    /**
     1347     * Return a formatted string displaying when a profile was last updated.
     1348     *
     1349     * @return bool|mixed|void
     1350     */
    10941351    function bp_get_profile_last_updated() {
    10951352
     
    11111368    }
    11121369
     1370/**
     1371 * Display the current profile group ID.
     1372 */
    11131373function bp_current_profile_group_id() {
    11141374    echo bp_get_current_profile_group_id();
    11151375}
     1376
     1377    /**
     1378     * Return the current profile group ID.
     1379     *
     1380     * @since 1.1.0
     1381     *
     1382     * @return mixed|void
     1383     */
    11161384    function bp_get_current_profile_group_id() {
    11171385        $profile_group_id = bp_action_variable( 1 );
     
    11321400    }
    11331401
     1402/**
     1403 * Render an avatar delete link.
     1404 */
    11341405function bp_avatar_delete_link() {
    11351406    echo bp_get_avatar_delete_link();
    11361407}
     1408
     1409    /**
     1410     * Return an avatar delete link.
     1411     *
     1412     * @since 1.1.0
     1413     * @return mixed|void
     1414     */
    11371415    function bp_get_avatar_delete_link() {
    11381416
     
    11471425    }
    11481426
     1427/**
     1428 * Render an edit profile button.
     1429 */
    11491430function bp_edit_profile_button() {
    11501431    bp_button( array(
     
    11741455     *
    11751456     * @param array|string $args Args for the radio buttons.
    1176      *
    11771457     * @return string $retval
    11781458     */
     
    12531533     *
    12541534     * @param array|string $args Args for the select list.
    1255      *
    12561535     * @return string $retval
    12571536     */
     
    13201599 *
    13211600 * @since 2.4.0
    1322  *
    1323  * @return string HTML for the required label.
    13241601 */
    13251602function bp_the_profile_field_required_label() {
Note: See TracChangeset for help on using the changeset viewer.