WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
147 |
|
148 | $trimmed_excerpt = get_the_excerpt( $post ); |
149 |
|
150 | /* |
151 | * Adds a "Read more" link with screen reader text. |
152 | * […] is the default excerpt ending from wp_trim_excerpt() in Core. |
153 | */ |
154 | if ( str_ends_with( $trimmed_excerpt, ' […]' ) ) { |
155 | /** This filter is documented in wp-includes/formatting.php */ |
156 | $excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length ); |
157 | if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) { |
158 | $trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 ); |
159 | $trimmed_excerpt .= sprintf( |
160 | /* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */ |
161 | __( '… <a class="wp-block-latest-posts__read-more" href="%1$s" rel="noopener noreferrer">Read more<span class="screen-reader-text">: %2$s</span></a>' ), |
162 | esc_url( $post_link ), |
163 | esc_html( $title ) |
164 | ); |
165 | } |