WordPress.org

Make WordPress Core

Opened 7 weeks ago

Last modified 14 hours ago

#54580 reopened feature request

Latest Posts Gutenberg Block not supporting args filter.

Reported by: martin7ba Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8.2
Component: Editor Keywords: reporter-feedback has-patch
Focuses: rest-api Cc:

Description

Shouldn't we add the filter for recent posts widget arguments in the Latest Posts Block?

<?php
$args = apply_filters(
                'widget_posts_args',
                $args
        );

I didn't find it in the core wp-includes/blocks/latest-posts.php

This breaks the functionality in my plugin for hiding posts in the Recent Posts Widget.

Attachments (1)

54580.diff (480 bytes) - added by martin7ba 7 weeks ago.
Added filter for arguments for latest posts block

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
7 weeks ago

  • Component changed from Widgets to Editor

Hi there, welcome to WordPress Trac! Thanks for the report.

Moving this to the Editor component for more visibility, as it seems to be more related to the Latest Posts block than the Recent Posts widget.

Also noting that this needs to be fixed in the block-library package upstream and then backported to core. Could you create an issue or PR at https://github.com/WordPress/gutenberg? Thanks!

#2 @martin7ba
7 weeks ago

  • Resolution set to invalid
  • Status changed from new to closed

Hi, thank you.

Well, the Latest Posts block is used as a Recent Widget in the Widgets Area now that the Widgets area was upgraded to use Gutenberg Blocks as widgets.

The changes need to be applied in the /wp-includes/blocks/latest-posts.php file.

I am still new to contributing to WP Core..once I read the how the PR are added on Git, I will try to create a PR there.

#3 @martin7ba
7 weeks ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

@martin7ba
7 weeks ago

Added filter for arguments for latest posts block

This ticket was mentioned in PR #2197 on WordPress/wordpress-develop by martinjankov.


14 hours ago

  • Keywords has-patch added
Note: See TracTickets for help on using tickets.