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 |
|---|---|
| 142 | && isset( $attributes['displayPostContentRadio'] ) && 'excerpt' === $attributes['displayPostContentRadio'] ) { |
| 143 | |
| 144 | $trimmed_excerpt = get_the_excerpt( $post ); |
| 145 | |
| 146 | /* |
| 147 | * Adds a "Read more" link with screen reader text. |
| 148 | * […] is the default excerpt ending from wp_trim_excerpt() in Core. |
| 149 | */ |
| 150 | if ( str_ends_with( $trimmed_excerpt, ' […]' ) ) { |
| 151 | $excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length ); |
| 152 | if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) { |
| 153 | $trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 ); |
| 154 | $trimmed_excerpt .= sprintf( |
| 155 | /* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */ |
| 156 | __( '… <a href="%1$s" rel="noopener noreferrer">Read more<span class="screen-reader-text">: %2$s</span></a>' ), |
| 157 | esc_url( $post_link ), |
| 158 | esc_html( $title ) |
| 159 | ); |
| 160 | } |