Make WordPress Core

Opened 22 months ago

Last modified 20 months ago

#54580 reopened feature request

Latest Posts Gutenberg Block not supporting args filter.

Reported by: martin7ba's profile 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 22 months ago.
Added filter for arguments for latest posts block

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
22 months 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
22 months 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
22 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

@martin7ba
22 months ago

Added filter for arguments for latest posts block

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


21 months ago
#4

  • Keywords has-patch added

#5 @martin7ba
20 months ago

@SergeyBiryukov I mentioned this ticket and PR I had in the core-editor chat and they pointed out to me that all block related updates should be done in the Guttenberg repo.

Therefore I created new PR on the Gutenberg repo
https://github.com/WordPress/gutenberg/pull/38283

Version 0, edited 20 months ago by martin7ba (next)
Note: See TracTickets for help on using tickets.