diff --git src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php
index 8fa9753e8..466d98ec1 100644
|
|
|
34 | 34 | |
35 | 35 | <script type="text/html" id="tmpl-bp-messages-editor"> |
36 | 36 | <?php |
37 | | // Temporarily filter the editor |
38 | | add_filter( 'mce_buttons', 'bp_nouveau_mce_buttons', 10, 1 ); |
| 37 | // Add a temporary filter on editor buttons |
| 38 | add_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 ); |
39 | 39 | |
40 | 40 | wp_editor( |
41 | 41 | '', |
… |
… |
|
51 | 51 | 'textarea_rows' => 5, |
52 | 52 | ) |
53 | 53 | ); |
54 | | // Temporarily filter the editor |
55 | | remove_filter( 'mce_buttons', 'bp_nouveau_mce_buttons', 10, 1 ); |
| 54 | // Remove the temporary filter on editor buttons |
| 55 | remove_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 ); |
56 | 56 | ?> |
57 | 57 | </script> |
58 | 58 | |
diff --git src/bp-templates/bp-nouveau/css/buddypress-rtl.css src/bp-templates/bp-nouveau/css/buddypress-rtl.css
index afeca9358..8f0afc6a0 100644
|
|
body.register .buddypress-wrap .page ul { |
3064 | 3064 | } |
3065 | 3065 | |
3066 | 3066 | .bp-messages-content #thread-preview .preview-message { |
3067 | | clear: both; |
| 3067 | overflow: hidden; |
3068 | 3068 | } |
3069 | 3069 | |
3070 | 3070 | .bp-messages-content #thread-preview .preview-content { |
… |
… |
body.register .buddypress-wrap .page ul { |
3133 | 3133 | } |
3134 | 3134 | |
3135 | 3135 | .bp-messages-content #bp-message-thread-list .message-content { |
3136 | | clear: both; |
| 3136 | overflow: hidden; |
3137 | 3137 | margin: 1em auto 0; |
3138 | 3138 | width: 90%; |
3139 | 3139 | } |
diff --git src/bp-templates/bp-nouveau/css/buddypress.css src/bp-templates/bp-nouveau/css/buddypress.css
index 5e7528dce..f838f12fe 100644
|
|
body.register .buddypress-wrap .page ul { |
3064 | 3064 | } |
3065 | 3065 | |
3066 | 3066 | .bp-messages-content #thread-preview .preview-message { |
3067 | | clear: both; |
| 3067 | overflow: hidden; |
3068 | 3068 | } |
3069 | 3069 | |
3070 | 3070 | .bp-messages-content #thread-preview .preview-content { |
… |
… |
body.register .buddypress-wrap .page ul { |
3133 | 3133 | } |
3134 | 3134 | |
3135 | 3135 | .bp-messages-content #bp-message-thread-list .message-content { |
3136 | | clear: both; |
| 3136 | overflow: hidden; |
3137 | 3137 | margin: 1em auto 0; |
3138 | 3138 | width: 90%; |
3139 | 3139 | } |
diff --git src/bp-templates/bp-nouveau/includes/messages/functions.php src/bp-templates/bp-nouveau/includes/messages/functions.php
index eb9ad5d0d..09df54607 100644
|
|
function bp_nouveau_push_sitewide_notices() { |
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
| 302 | * Custom kses filtering for message content. |
| 303 | * |
| 304 | * @since 3.0.0 |
| 305 | * |
| 306 | * @param string $content The message content. |
| 307 | * @return string The filtered message content. |
| 308 | */ |
| 309 | function bp_nouveau_messages_filter_kses( $content ) { |
| 310 | global $allowedtags; |
| 311 | |
| 312 | return wp_kses( $content, array_merge( $allowedtags, array( |
| 313 | 'a' => array( |
| 314 | 'aria-label' => true, |
| 315 | 'class' => true, |
| 316 | 'data-bp-tooltip' => true, |
| 317 | 'id' => true, |
| 318 | 'rel' => true, |
| 319 | 'title' => true, |
| 320 | ), |
| 321 | 'img' => array( |
| 322 | 'src' => true, |
| 323 | 'alt' => true, |
| 324 | 'width' => true, |
| 325 | 'height' => true, |
| 326 | 'class' => true, |
| 327 | 'id' => true, |
| 328 | ), |
| 329 | 'span'=> array( |
| 330 | 'class' => true, |
| 331 | 'data-livestamp' => true, |
| 332 | ), |
| 333 | 'p' => true, |
| 334 | 'ul' => true, |
| 335 | 'ol' => true, |
| 336 | 'li' => true, |
| 337 | ) ) ); |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * Disable the WP Editor buttons not allowed in messages content. |
| 342 | * |
302 | 343 | * @since 3.0.0 |
| 344 | * |
| 345 | * @param array $buttons The WP Editor buttons list. |
| 346 | * @param array The filtered WP Editor buttons list. |
303 | 347 | */ |
304 | | function bp_nouveau_mce_buttons( $buttons = array() ) { |
| 348 | function bp_nouveau_messages_mce_buttons( $buttons = array() ) { |
305 | 349 | $remove_buttons = array( |
306 | 350 | 'wp_more', |
307 | 351 | 'spellchecker', |
308 | 352 | 'wp_adv', |
309 | 353 | 'fullscreen', |
| 354 | 'alignleft', |
| 355 | 'alignright', |
| 356 | 'aligncenter', |
| 357 | 'formatselect', |
310 | 358 | ); |
311 | 359 | |
312 | 360 | // Remove unused buttons |
diff --git src/bp-templates/bp-nouveau/includes/messages/loader.php src/bp-templates/bp-nouveau/includes/messages/loader.php
index f979c5630..828a430ee 100644
|
|
class BP_Nouveau_Messages { |
107 | 107 | remove_filter( 'messages_message_content_before_save', 'wp_filter_kses', 1 ); |
108 | 108 | remove_filter( 'bp_get_the_thread_message_content', 'wp_filter_kses', 1 ); |
109 | 109 | |
110 | | add_filter( 'messages_notice_message_before_save', 'wp_filter_post_kses', 1 ); |
111 | | add_filter( 'messages_message_content_before_save', 'wp_filter_post_kses', 1 ); |
112 | | add_filter( 'bp_get_the_thread_message_content', 'wp_filter_post_kses', 1 ); |
113 | | add_filter( 'bp_get_message_thread_content', 'wp_filter_post_kses', 1 ); |
| 110 | add_filter( 'messages_notice_message_before_save', 'bp_nouveau_messages_filter_kses', 1 ); |
| 111 | add_filter( 'messages_message_content_before_save', 'bp_nouveau_messages_filter_kses', 1 ); |
| 112 | add_filter( 'bp_get_the_thread_message_content', 'bp_nouveau_messages_filter_kses', 1 ); |
| 113 | add_filter( 'bp_get_message_thread_content', 'bp_nouveau_messages_filter_kses', 1 ); |
114 | 114 | add_filter( 'bp_get_message_thread_content', 'wptexturize' ); |
115 | 115 | add_filter( 'bp_get_message_thread_content', 'stripslashes_deep', 1 ); |
116 | 116 | add_filter( 'bp_get_message_thread_content', 'convert_smilies', 2 ); |
diff --git src/bp-templates/bp-nouveau/sass/_nouveau_messages.scss src/bp-templates/bp-nouveau/sass/_nouveau_messages.scss
index 89747071c..a9a44a599 100644
|
|
|
192 | 192 | margin-top: $marg-lrg; |
193 | 193 | |
194 | 194 | .preview-message { |
195 | | clear: both; |
| 195 | overflow: hidden; |
196 | 196 | } |
197 | 197 | |
198 | 198 | .preview-content { |
… |
… |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | .message-content { |
266 | | clear: both; |
| 266 | overflow: hidden; |
267 | 267 | margin: 1em auto 0; |
268 | 268 | width: 90%; |
269 | 269 | } |