rebase on oct-10-2023
This commit is contained in:
@@ -48,6 +48,14 @@ function render_block_core_latest_posts( $attributes ) {
|
||||
$block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
|
||||
add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
|
||||
|
||||
$filter_latest_posts_excerpt_more = static function( $more ) use ( $attributes ) {
|
||||
$use_excerpt = 'excerpt' === $attributes['displayPostContentRadio'];
|
||||
/* translators: %1$s is a URL to a post, excerpt truncation character, default … */
|
||||
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>' ), esc_url( get_permalink() ) ) : $more;
|
||||
};
|
||||
|
||||
add_filter( 'excerpt_more', $filter_latest_posts_excerpt_more );
|
||||
|
||||
if ( isset( $attributes['categories'] ) ) {
|
||||
$args['category__in'] = array_column( $attributes['categories'], 'id' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user