Ticket #2542: meta-2542.patch
File meta-2542.patch, 5.8 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
24 24 // Disable inline terms and mentions. 25 25 add_action( 'plugins_loaded', array( $this, 'disable_inline_terms' ) ); 26 26 27 // Replace bbp_make_mentions_clickable() to add `class="mention"`. 28 remove_filter( 'bbp_make_clickable', 'bbp_make_mentions_clickable', 8 ); 29 add_filter( 'bbp_make_clickable', array( $this, 'make_mentions_clickable' ), 8 ); 30 27 31 // Add notice to reply forms for privileged users in closed forums. 28 32 add_action( 'bbp_template_notices', array( $this, 'closed_forum_notice_for_moderators' ), 1 ); 29 33 … … 138 142 } 139 143 140 144 /** 145 * Make mentions clickable in content areas. 146 * 147 * @param string $text 148 * @return string 149 */ 150 function make_mentions_clickable( $text = '' ) { 151 return preg_replace_callback( '#([\s>])@([0-9a-zA-Z-_]+)#i', array( $this, 'make_mentions_clickable_callback' ), $text ); 152 } 153 154 /** 155 * Callback to convert mention matchs to HTML A tag. 156 * 157 * Replaces bbp_make_mentions_clickable_callback() to add `class="mention"` 158 * for styling purposes. 159 * 160 * @see https://meta.trac.wordpress.org/ticket/2542 161 * 162 * @param array $matches Single Regex Match. 163 * @return string HTML A tag with link to user profile. 164 */ 165 function make_mentions_clickable_callback( $matches = array() ) { 166 167 // Get user; bail if not found 168 $user = get_user_by( 'slug', $matches[2] ); 169 if ( empty( $user ) || bbp_is_user_inactive( $user->ID ) ) { 170 return $matches[0]; 171 } 172 173 // Create the link to the user's profile 174 $url = bbp_get_user_profile_url( $user->ID ); 175 $anchor = '<a href="%1$s" class="mention" rel="nofollow">@%2$s</a>'; 176 $link = sprintf( $anchor, esc_url( $url ), esc_html( $user->user_nicename ) ); 177 178 return $matches[1] . $link; 179 } 180 181 /** 141 182 * For closed forums, adds a notice to privileged users indicating that 142 183 * though the reply form is available, the forum is closed. 143 184 * -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/sass/site/_bbpress.scss
190 190 margin: 0 2.5% 0 5%; 191 191 } 192 192 193 div.bbp-reply-content a, 194 div.bbp-topic-content a { 195 text-decoration: underline; 196 font-weight: inherit; 197 } 198 199 div.bbp-reply-content a.mention, 200 div.bbp-topic-content a.mention { 201 text-decoration: none; 202 font-weight: bold; 203 } 204 193 205 li.bbp-body div.type-topic:hover span.bbp-admin-links, 194 206 li.bbp-body div.type-reply:hover span.bbp-admin-links { 195 207 bottom: 0; … … 728 740 div.bbp-topic-content { 729 741 padding: 0; 730 742 margin: 0 0 0 10%; 731 732 a {733 font-weight: inherit;734 }735 743 } 736 744 737 745 div.bbp-reply-content { -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/style-rtl.css
2667 2667 margin: 0 5% 0 2.5%; 2668 2668 } 2669 2669 2670 .bbpress #bbpress-forums div.bbp-reply-content a, 2671 .bbpress #bbpress-forums div.bbp-topic-content a { 2672 text-decoration: underline; 2673 font-weight: inherit; 2674 } 2675 2676 .bbpress #bbpress-forums div.bbp-reply-content a.mention, 2677 .bbpress #bbpress-forums div.bbp-topic-content a.mention { 2678 text-decoration: none; 2679 font-weight: bold; 2680 } 2681 2670 2682 .bbpress #bbpress-forums li.bbp-body div.type-topic:hover span.bbp-admin-links, 2671 2683 .bbpress #bbpress-forums li.bbp-body div.type-reply:hover span.bbp-admin-links { 2672 2684 bottom: 0; … … 3225 3237 margin: 0 10% 0 0; 3226 3238 } 3227 3239 3228 .single-topic .entry-content #bbpress-forums div.bbp-forum-content a,3229 .single-topic .entry-content #bbpress-forums div.bbp-reply-content a,3230 .single-topic .entry-content #bbpress-forums div.bbp-topic-content a {3231 font-weight: inherit;3232 }3233 3234 3240 .single-topic .entry-content #bbpress-forums div.bbp-reply-content { 3235 3241 margin-right: 11%; 3236 3242 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/style.css
2669 2669 margin: 0 2.5% 0 5%; 2670 2670 } 2671 2671 2672 .bbpress #bbpress-forums div.bbp-reply-content a, 2673 .bbpress #bbpress-forums div.bbp-topic-content a { 2674 text-decoration: underline; 2675 font-weight: inherit; 2676 } 2677 2678 .bbpress #bbpress-forums div.bbp-reply-content a.mention, 2679 .bbpress #bbpress-forums div.bbp-topic-content a.mention { 2680 text-decoration: none; 2681 font-weight: bold; 2682 } 2683 2672 2684 .bbpress #bbpress-forums li.bbp-body div.type-topic:hover span.bbp-admin-links, 2673 2685 .bbpress #bbpress-forums li.bbp-body div.type-reply:hover span.bbp-admin-links { 2674 2686 bottom: 0; … … 3227 3239 margin: 0 0 0 10%; 3228 3240 } 3229 3241 3230 .single-topic .entry-content #bbpress-forums div.bbp-forum-content a,3231 .single-topic .entry-content #bbpress-forums div.bbp-reply-content a,3232 .single-topic .entry-content #bbpress-forums div.bbp-topic-content a {3233 font-weight: inherit;3234 }3235 3236 3242 .single-topic .entry-content #bbpress-forums div.bbp-reply-content { 3237 3243 margin-left: 11%; 3238 3244 }