Changeset 13635
- Timestamp:
- 05/01/2024 12:38:08 AM (5 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/functions.php
r13608 r13635 1201 1201 */ 1202 1202 function wporg_support_wrap_standalone_li_tags_in_ul( $content ) { 1203 remove_filter( current_filter(), 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 1204 1203 1205 // No lists? No worries. 1204 1206 if ( false === stripos( $content, '<li>' ) ) { … … 1251 1253 return $content; 1252 1254 } 1253 add_filter( 'bbp_get_topic_content', 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 1254 add_filter( 'bbp_get_reply_content', 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 1255 1256 /** 1257 * Maybe wrap standalone <li> tags in <ul> tags. 1258 * This only wraps non-block-posts. 1259 * 1260 * @see https://meta.trac.wordpress.org/ticket/7618 1261 */ 1262 function wporg_support_maybe_wrap_standalone_li_tags_in_ul( $content ) { 1263 // If it's not a block post, we'll need to filter it after all transforms. 1264 if ( ! has_blocks( $content ) ) { 1265 add_filter( current_filter(), 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 1266 } 1267 1268 return $content; 1269 } 1270 add_filter( 'bbp_get_topic_content', 'wporg_support_maybe_wrap_standalone_li_tags_in_ul', 1 ); 1271 add_filter( 'bbp_get_reply_content', 'wporg_support_maybe_wrap_standalone_li_tags_in_ul', 1 ); 1255 1272 1256 1273 /** -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php
r13168 r13635 863 863 */ 864 864 function wporg_support_wrap_standalone_li_tags_in_ul( $content ) { 865 remove_filter( current_filter(), 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 866 865 867 // No lists? No worries. 866 868 if ( false === stripos( $content, '<li>' ) ) { … … 913 915 return $content; 914 916 } 915 add_filter( 'bbp_get_topic_content', 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 916 add_filter( 'bbp_get_reply_content', 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 917 918 /** 919 * Maybe wrap standalone <li> tags in <ul> tags. 920 * This only wraps non-block-posts. 921 * 922 * @see https://meta.trac.wordpress.org/ticket/7618 923 */ 924 function wporg_support_maybe_wrap_standalone_li_tags_in_ul( $content ) { 925 // If it's not a block post, we'll need to filter it after all transforms. 926 if ( ! has_blocks( $content ) ) { 927 add_filter( current_filter(), 'wporg_support_wrap_standalone_li_tags_in_ul', 50 ); 928 } 929 930 return $content; 931 } 932 add_filter( 'bbp_get_topic_content', 'wporg_support_maybe_wrap_standalone_li_tags_in_ul', 1 ); 933 add_filter( 'bbp_get_reply_content', 'wporg_support_maybe_wrap_standalone_li_tags_in_ul', 1 ); 917 934 918 935 /**
Note: See TracChangeset
for help on using the changeset viewer.