Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#54580 reopened feature request

Latest Posts Gutenberg Block not supporting args filter.

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

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 5 years ago.
Added filter for arguments for latest posts block

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
5 years ago

  • Component WidgetsEditor

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
5 years ago

  • Resolutioninvalid
  • Status newclosed

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
5 years ago

  • Resolution invalid
  • Status closedreopened

@martin7ba
5 years ago

Added filter for arguments for latest posts block

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


5 years ago
#4

  • Keywords has-patch added

#5 @martin7ba
5 years 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 5 years ago by martin7ba (next)
Note: See TracTickets for help on using tickets.