Make WordPress Core


Ignore:
Timestamp:
07/17/2023 01:45:24 AM (2 years ago)
Author:
isabel_brison
Message:

Editor: trim footnote anchors from post excerpts.

Adds the excerpt_remove_footnotes function to trim footnote anchors from post excerpts.

Props: ramonopoly, costdev, mukesh27, mcsf, azaozz.
Fixes #58805.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r56191 r56244  
    39533953 * @since 1.5.0
    39543954 * @since 5.2.0 Added the `$post` parameter.
     3955 * @since 6.3.0 Removes footnotes markup from the excerpt content.
    39553956 *
    39563957 * @param string             $text Optional. The excerpt. If set to empty, an excerpt is generated.
     
    39673968        $text = strip_shortcodes( $text );
    39683969        $text = excerpt_remove_blocks( $text );
     3970        $text = excerpt_remove_footnotes( $text );
    39693971
    39703972        /*
     
    40094011        $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' );
    40104012        $text         = wp_trim_words( $text, $excerpt_length, $excerpt_more );
     4013
    40114014    }
    40124015
Note: See TracChangeset for help on using the changeset viewer.