Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/19/2015 01:40:26 AM (9 years ago)
Author:
tw2113
Message:

First pass at members component docs cleanup.

See #6402.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-template.php

    r9819 r9877  
    22
    33/**
    4  * BuddyPress Member Template Tags
     4 * BuddyPress Member Template Tags.
    55 *
    66 * Functions that are safe to use inside your template files and themes.
     
    232232
    233233    /**
    234      * The unique string used for pagination queries
     234     * The unique string used for pagination queries.
    235235     *
    236236     * @access public
    237      * @var public
     237     * @var string
    238238     */
    239239    public $pag_arg;
     
    243243     *
    244244     * @access public
    245      * @var public
     245     * @var string
    246246     */
    247247    public $pag_page;
     
    251251     *
    252252     * @access public
    253      * @var public
     253     * @var string
    254254     */
    255255    public $pag_num;
     
    287287     * @param array        $meta_key        Limit to users with a meta_key.
    288288     * @param array        $meta_value      Limit to users with a meta_value (with meta_key).
    289      * @param array        $page_arg        Optional. The string used as a query parameter in pagination links.
     289     * @param string       $page_arg        Optional. The string used as a query parameter in pagination links.
    290290     *                                      Default: 'upage'.
    291291     * @param array|string $member_type     Array or comma-separated string of member types to limit results to.
     
    467467 * @global object $members_template {@link BP_Members_Template}
    468468 *
    469  * @param array $args {
     469 * @param array|string $args {
    470470 *     Arguments for limiting the contents of the members loop. Most arguments
    471471 *     are in the same format as {@link BP_User_Query}. However, because
     
    497497 *     @type string                $search_terms    Limit results by a search term. Default: null.
    498498 *     @type string                $meta_key        Limit results by the presence of a usermeta key.
    499  *           Default: false.
     499 *                                                  Default: false.
    500500 *     @type mixed                 $meta_value      When used with meta_key, limits results by the
    501  *           a matching usermeta value. Default: false.
     501 *                                                  a matching usermeta value. Default: false.
    502502 *     @type bool                  $populate_extras Whether to fetch optional data, such as
    503  *           friend counts. Default: true.
     503 *                                                  friend counts. Default: true.
    504504 * }
    505505 * @return bool Returns true when blogs are found, otherwise false.
     
    862862 * @see bp_get_member_avatar() for description of arguments.
    863863 *
    864  * @param array $args See {@link bp_get_member_avatar()}.
     864 * @param array|string $args See {@link bp_get_member_avatar()}.
    865865 */
    866866function bp_member_avatar( $args = '' ) {
     
    872872     *
    873873     * @param string $value Formatted HTML <img> element,
    874      *                      or raw avatar URL based on $html arg
     874     *                      or raw avatar URL based on $html arg.
    875875     */
    876876    echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ) );
     
    882882     *      return values.
    883883     *
    884      * @param array $args  {
     884     * @param array|string $args  {
    885885     *     Arguments are listed here with an explanation of their defaults.
    886886     *     For more information about the arguments, see
    887887     *     {@link bp_core_fetch_avatar()}.
    888      *     @type string $alt Default: 'Profile picture of [user name]'.
    889      *     @type string $class Default: 'avatar'.
    890      *     @type string $type Default: 'thumb'.
    891      *     @type int|bool $width Default: false.
    892      *     @type int|bool $height Default: false.
    893      *     @type bool $id Currently unused.
    894      *     @type bool $no_grav Default: false.
     888     *     @type string   $alt    Default: 'Profile picture of [user name]'.
     889     *     @type string   $class  Default: 'avatar'.
     890     *     @type string   $type    Default: 'thumb'.
     891     *     @type int|bool $width   Default: false.
     892     *     @type int|bool $height  Default: false.
     893     *     @type bool     $id      Currently unused.
     894     *     @type bool     $no_grav Default: false.
    895895     * }
    896896     * @return string User avatar string.
     
    919919         *
    920920         * @param string $value Formatted HTML <img> element,
    921          *                      or raw avatar URL based on $html arg
     921         *                      or raw avatar URL based on $html arg.
    922922         */
    923923        return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) );
     
    10321032     *     Array of optional arguments.
    10331033     *     @type mixed $active_format If true, formatted "active 5 minutes
    1034      *           ago". If false, formatted "5 minutes ago". If string, should
    1035      *           be sprintf'able like 'last seen %s ago'.
     1034     *                                ago". If false, formatted "5 minutes ago".
     1035     *                                If string, should be sprintf'able like
     1036     *                                'last seen %s ago'.
    10361037     * }
    10371038     * @return string
     
    10761077/**
    10771078 * Output the latest update of the current member in the loop.
     1079 *
     1080 * @param array|string $args
    10781081 */
    10791082function bp_member_latest_update( $args = '' ) {
     
    10831086     * Get the latest update from the current member in the loop.
    10841087     *
    1085      * @param array $args {
     1088     * @param array|string $args {
    10861089     *     Array of optional arguments.
    1087      *     @type int $length Truncation length. Default: 225.
     1090     *     @type int  $length    Truncation length. Default: 225.
    10881091     *     @type bool $view_link Whether to provide a 'View' link for
    1089      *           truncated entries. Default: false.
     1092     *                           truncated entries. Default: false.
    10901093     * }
    10911094     * @return string
     
    11391142 * @see bp_get_member_profile_data() for a description of params.
    11401143 *
    1141  * @param array $args See {@link bp_get_member_profile_data()}.
     1144 * @param array|string $args See {@link bp_get_member_profile_data()}.
    11421145 */
    11431146function bp_member_profile_data( $args = '' ) {
     
    11511154     * to use outside of the loop.
    11521155     *
    1153      * @param array $args {
     1156     * @param array|string $args {
    11541157     *     Array of config parameters.
    1155      *     @type string $field Name of the profile field.
    1156      *     @type int $user_id ID of the user whose data is being fetched.
    1157      *           Defaults to the current member in the loop, or if not
    1158      *           present, to the currently displayed user.
     1158     *     @type string $field   Name of the profile field.
     1159     *     @type int    $user_id ID of the user whose data is being fetched.
     1160     *                           Defaults to the current member in the loop, or if not
     1161     *                           present, to the currently displayed user.
    11591162     * }
    11601163     * @return string|bool Profile data if found, otherwise false.
     
    14131416 *
    14141417 * @see bp_get_loggedin_user_avatar() for a description of params.
     1418 *
     1419 * @param array|string $args
    14151420 */
    14161421function bp_loggedin_user_avatar( $args = '' ) {
     
    14231428     *      return values.
    14241429     *
    1425      * @param array $args  {
     1430     * @param array|string $args  {
    14261431     *     Arguments are listed here with an explanation of their defaults.
    14271432     *     For more information about the arguments, see
    14281433     *     {@link bp_core_fetch_avatar()}.
    1429      *     @type string $alt Default: 'Profile picture of [user name]'.
    1430      *     @type bool $html Default: true.
    1431      *     @type string $type Default: 'thumb'.
    1432      *     @type int|bool $width Default: false.
     1434     *     @type string   $alt    Default: 'Profile picture of [user name]'.
     1435     *     @type bool     $html  Default: true.
     1436     *     @type string   $type  Default: 'thumb'.
     1437     *     @type int|bool $width  Default: false.
    14331438     *     @type int|bool $height Default: false.
    14341439     * }
     
    14601465 *
    14611466 * @see bp_get_displayed_user_avatar() for a description of params.
     1467 *
     1468 * @param array|string $args
    14621469 */
    14631470function bp_displayed_user_avatar( $args = '' ) {
     
    14701477     *      return values.
    14711478     *
    1472      * @param array $args  {
     1479     * @param array|string $args  {
    14731480     *     Arguments are listed here with an explanation of their defaults.
    14741481     *     For more information about the arguments, see
    14751482     *     {@link bp_core_fetch_avatar()}.
    1476      *     @type string $alt Default: 'Profile picture of [user name]'.
    1477      *     @type bool $html Default: true.
    1478      *     @type string $type Default: 'thumb'.
    1479      *     @type int|bool $width Default: false.
     1483     *     @type string   $alt    Default: 'Profile picture of [user name]'.
     1484     *     @type bool     $html  Default: true.
     1485     *     @type string   $type  Default: 'thumb'.
     1486     *     @type int|bool $width  Default: false.
    14801487     *     @type int|bool $height Default: false.
    14811488     * }
     
    15551562     *
    15561563     * @param int $user_id ID of the user. Default: displayed user ID.
     1564     *
    15571565     * @return string
    15581566     */
     
    15851593     * Simply takes all the characters before the first space in a name.
    15861594     *
    1587      * @param string $name Full name to use when generating first name.
    1588      *        Defaults to displayed user's first name, or to logged-in
    1589      *        user's first name if it's unavailable.
     1595     * @param string|bool $name Full name to use when generating first name.
     1596     *                          Defaults to displayed user's first name, or to
     1597     *                          logged-in user's first name if it's unavailable.
    15901598     * @return string
    15911599     */
     
    21932201 * @see bp_get_signup_avatar() for description of arguments.
    21942202 *
    2195  * @param array $args See {@link bp_get_signup_avatar(}.
     2203 * @param array|string $args See {@link bp_get_signup_avatar(}.
    21962204 */
    21972205function bp_signup_avatar( $args = '' ) {
     
    22032211     * @see bp_core_fetch_avatar() for description of arguments.
    22042212     *
    2205      * @param array $args {
     2213     * @param array|string $args {
    22062214     *     Array of optional arguments.
    2207      *     @type int $size Height/weight in pixels. Default: value of
    2208      *           bp_core_avatar_full_width().
     2215     *     @type int    $size Height/weight in pixels. Default: value of
     2216     *                         bp_core_avatar_full_width().
    22092217     *     @type string $class CSS class. Default: 'avatar'.
    2210      *     @type string $alt HTML 'alt' attribute. Default: 'Your Avatar'.
     2218     *     @type string $alt   HTML 'alt' attribute. Default: 'Your Avatar'.
    22112219     * }
    22122220     * @return string
     
    23322340 * @see bp_get_members_component_link() for description of parameters.
    23332341 *
    2334  * @param string $component See {@bp_get_members_component_link()}.
    2335  * @param string $action See {@bp_get_members_component_link()}.
    2336  * @param string $query_args See {@bp_get_members_component_link()}.
    2337  * @param string $nonce See {@bp_get_members_component_link()}.
     2342 * @param string      $component See {@bp_get_members_component_link()}.
     2343 * @param string      $action See {@bp_get_members_component_link()}.
     2344 * @param string      $query_args See {@bp_get_members_component_link()}.
     2345 * @param string|bool $nonce See {@bp_get_members_component_link()}.
    23382346 */
    23392347function bp_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) {
     
    23432351     * Generate a link to a members component subpage.
    23442352     *
    2345      * @param string $component ID of the component (eg 'friends').
    2346      * @param string $action Optional. 'action' slug (eg 'invites').
    2347      * @param array $query_args Optional. Array of URL params to add to the
    2348      *        URL. See {@link add_query_arg()} for format.
    2349      * @param array $nonce Optional. If provided, the URL will be passed
    2350      *        through wp_nonce_url() with $nonce as the action string.
     2353     * @param string       $component  ID of the component (eg 'friends').
     2354     * @param string       $action     Optional. 'action' slug (eg 'invites').
     2355     * @param array|string $query_args Optional. Array of URL params to add to the
     2356     *                                 URL. See {@link add_query_arg()} for format.
     2357     * @param array|bool   $nonce      Optional. If provided, the URL will be passed
     2358     *                                 through wp_nonce_url() with $nonce as the
     2359     *                                 action string.
    23512360     * @return string
    23522361     */
Note: See TracChangeset for help on using the changeset viewer.