Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/15/2015 07:13:42 PM (11 years ago)
Author:
tw2113
Message:

More documentation cleanup for part of BP-Core component.

See #6398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-button.php

    r10108 r10355  
    144144    public $link_text = '';
    145145
    146     /** HTML result ***********************************************************/
    147 
     146    /** HTML result
     147     *
     148     * @var string
     149     */
    148150    public $contents = '';
    149151
     
    161163        $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) );
    162164
    163         // Required button properties
     165        // Required button properties.
    164166        $this->id                = $r['id'];
    165167        $this->component         = $r['component'];
     
    172174            return false;
    173175
    174         // No button if component is not active
     176        // No button if component is not active.
    175177        if ( ! bp_is_active( $this->component ) )
    176178            return false;
    177179
    178         // No button for guests if must be logged in
     180        // No button for guests if must be logged in.
    179181        if ( true == $this->must_be_logged_in && ! is_user_logged_in() )
    180182            return false;
    181183
    182         // block_self
     184        // The block_self property.
    183185        if ( true == $this->block_self ) {
    184186            // No button if you are the current user in a members loop
    185187            // This condition takes precedence, because members loops
    186             // can be found on user profiles
     188            // can be found on user profiles.
    187189            if ( bp_get_member_user_id() ) {
    188190                if ( is_user_logged_in() && bp_loggedin_user_id() == bp_get_member_user_id() ) {
     
    191193
    192194            // No button if viewing your own profile (and not in
    193             // a members loop)
     195            // a members loop).
    194196            } elseif ( bp_is_my_profile() ) {
    195197                return false;
     
    197199        }
    198200
    199         // Wrapper properties
     201        // Wrapper properties.
    200202        if ( false !== $this->wrapper ) {
    201203
    202             // Wrapper ID
     204            // Wrapper ID.
    203205            if ( !empty( $r['wrapper_id'] ) ) {
    204206                $this->wrapper_id    = ' id="' . $r['wrapper_id'] . '"';
    205207            }
    206208
    207             // Wrapper class
     209            // Wrapper class.
    208210            if ( !empty( $r['wrapper_class'] ) ) {
    209211                $this->wrapper_class = ' class="generic-button ' . $r['wrapper_class'] . '"';
     
    212214            }
    213215
    214             // Set before and after
     216            // Set before and after.
    215217            $before = '<' . $r['wrapper'] . $this->wrapper_class . $this->wrapper_id . '>';
    216218            $after  = '</' . $r['wrapper'] . '>';
    217219
    218         // No wrapper
     220        // No wrapper.
    219221        } else {
    220222            $before = $after = '';
    221223        }
    222224
    223         // Link properties
     225        // Link properties.
    224226        if ( !empty( $r['link_id']    ) ) $this->link_id    = ' id="' .    $r['link_id']    . '"';
    225227        if ( !empty( $r['link_href']  ) ) $this->link_href  = ' href="' .  $r['link_href']  . '"';
     
    229231        if ( !empty( $r['link_text']  ) ) $this->link_text  =              $r['link_text'];
    230232
    231         // Build the button
     233        // Build the button.
    232234        $this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after;
    233235
Note: See TracChangeset for help on using the changeset viewer.