Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render_block_core_latest_posts() Add filter for The block attributes #11195

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/block-library/src/latest-posts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
* @return string Returns the post content with latest posts added.
*/
function render_block_core_latest_posts( $attributes ) {

/**
* Filter to allow plugins to override the The block attributes.
*
* @since 3.5.0
*
* @param array $attributes The block attributes.
*/
$attributes = apply_filters( 'render_block_core_latest_posts_attributes', $attributes );

$recent_posts = wp_get_recent_posts(
array(
'numberposts' => $attributes['postsToShow'],
Expand Down