Ticket #20: meta-20.patch
File meta-20.patch, 1.5 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
389 389 add_filter( 'bbp_get_topic_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 ); 390 390 add_filter( 'bbp_get_reply_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 ); 391 391 392 /** 393 * Prevent standalone <li> tags from breaking the theme layout. 394 * 395 * If a <li> tag is not preceded by <ul> or <ol>, prepend it with <ul> 396 * and let force_balance_tags() do the rest. 397 * 398 * @see https://meta.trac.wordpress.org/ticket/20 399 * 400 * @param string $content Topic or reply content. 401 * @return string Filtered content. 402 */ 403 function wporg_support_wrap_standalone_li_tags_in_ul( $content ) { 404 if ( false !== strpos( $content, '<li>' ) ) { 405 $content = preg_replace( '#(?<!<ul>\s|<ol>\s)<li>#', '<ul><li>', $content ); 406 $content = force_balance_tags( $content ); 407 } 392 408 409 return $content; 410 } 411 add_filter( 'bbp_get_topic_content', 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 412 add_filter( 'bbp_get_reply_content', 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 413 414 393 415 /** bb Base *******************************************************************/ 394 416 395 417 function bb_base_search_form() {