Changeset 56244
- Timestamp:
- 07/17/2023 01:45:24 AM (21 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r56183 r56244 1011 1011 1012 1012 /** 1013 * Parses footnotes markup out of a content string, 1014 * and renders those appropriate for the excerpt. 1015 * 1016 * @since 6.3.0 1017 * 1018 * @param string $content The content to parse. 1019 * @return string The parsed and filtered content. 1020 */ 1021 function excerpt_remove_footnotes( $content ) { 1022 if ( ! str_contains( $content, 'data-fn=' ) ) { 1023 return $content; 1024 } 1025 1026 return preg_replace( 1027 '_<sup data-fn="[^"]+" class="[^"]+">\s*<a href="[^"]+" id="[^"]+">\d+</a>\s*</sup>_', 1028 '', 1029 $content 1030 ); 1031 } 1032 1033 /** 1013 1034 * Renders inner blocks from the allowed wrapper blocks 1014 1035 * for generating an excerpt. -
trunk/src/wp-includes/formatting.php
r56191 r56244 3953 3953 * @since 1.5.0 3954 3954 * @since 5.2.0 Added the `$post` parameter. 3955 * @since 6.3.0 Removes footnotes markup from the excerpt content. 3955 3956 * 3956 3957 * @param string $text Optional. The excerpt. If set to empty, an excerpt is generated. … … 3967 3968 $text = strip_shortcodes( $text ); 3968 3969 $text = excerpt_remove_blocks( $text ); 3970 $text = excerpt_remove_footnotes( $text ); 3969 3971 3970 3972 /* … … 4009 4011 $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' ); 4010 4012 $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); 4013 4011 4014 } 4012 4015
Note: See TracChangeset
for help on using the changeset viewer.