excerpt_length хук-фильтрWP 1.0

Adds a "Read more" link with screen reader text. […] is the default excerpt ending from wp_trim_excerpt() in Core.

Использование

add_filter( 'excerpt_length', 'wp_kama_excerpt_length_filter' );

/**
 * Function for `excerpt_length` filter-hook.
 * 
 * @param  $block_core_latest_posts_excerpt_length 
 *
 * @return 
 */
function wp_kama_excerpt_length_filter( $block_core_latest_posts_excerpt_length ){

	// filter...
	return $block_core_latest_posts_excerpt_length;
}
$block_core_latest_posts_excerpt_length
-

Где вызывается хук

render_block_core_latest_posts()
excerpt_length
wp_trim_excerpt()
excerpt_length
wp-includes/blocks/latest-posts.php 151
$excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length );
wp-includes/formatting.php 4019
$excerpt_length = (int) apply_filters( 'excerpt_length', $excerpt_length );

Где используется хук в WordPress

wp-includes/blocks/latest-posts.php 191
remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
wp-includes/blocks/latest-posts.php 49
add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );