Making WordPress.org

Changeset 4873


Ignore:
Timestamp:
02/03/2017 10:58:49 PM (8 years ago)
Author:
coffee2code
Message:

Suport Forums, User Moderation: Add 'flagged' class to div wrapping link to unflag a user.

Props SergeyBiryukov.
See #2430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-user-moderation/inc/class-plugin.php

    r4113 r4873  
    271271        }
    272272
     273        $class = 'wporg-bbp-user-flag';
     274
    273275        if ( $this->is_user_flagged( $user_id ) ) {
    274276            $text = $r['unflag'];
    275277            $query_args = array( 'action' => 'wporg_bbp_unflag_user', 'user_id' => $user_id );
     278            $class .= ' flagged';
    276279        } else {
    277280            $text = $r['flag'];
     
    282285
    283286        $url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-flag_' . $user_id . '_' . $post_id ) );
    284         return sprintf( "<div class='wporg-bbp-user-flag'><a href='%s'>%s</a></div>",
     287        return sprintf( "<div class='%s'><a href='%s'>%s</a></div>",
     288            $class,
    285289            $url,
    286290            esc_html( $text ) );
Note: See TracChangeset for help on using the changeset viewer.