Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#55435 closed defect (bug) (duplicate)

use_block_editor_for_post_type filter is broken in 5.9.2

Reported by: haykuro's profile haykuro Owned by: audrasjb's profile audrasjb
Milestone: Priority: normal
Severity: normal Version: 6.0
Component: General Keywords:
Focuses: Cc:

Description

https://github.com/WordPress/WordPress/commit/93d4851bbf9175bd62859ae3d42d266dd947b1f8

This commit seems to have broken the use_block_editor_for_post_type filter in WP >= 5.9.

https://github.com/WordPress/WordPress/blob/5.9.2/wp-includes/default-filters.php#L592

Is part of default-filters:

<?php
add_action( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );

But that function _disable_block_editor_for_navigation_post_type is only registered if user is on admin screen.

So, if you're on homepage and try to: apply_filters( 'use_block_editor_for_post_type', true, 'post' ) it will return null and throw a warning:

call_user_func_array() expects parameter 1 to be a valid callback, function '_disable_block_editor_for_navigation_post_type' not found or invalid function name

Change History (4)

This ticket was mentioned in Slack in #slackhelp by haykuro. View the logs.


2 years ago

#2 @audrasjb
2 years ago

  • Milestone changed from Awaiting Review to 5.9.3
  • Owner set to audrasjb
  • Status changed from new to reviewing

Thanks for the report and welcome to WordPress Trac @haykuro,

Moving for 5.9.3 consideration.

#3 @haykuro
2 years ago

  • Resolution set to duplicate
  • Status changed from reviewing to closed

Duplicate of #54795.

I just noticed there's an existing similar ticket here: https://core.trac.wordpress.org/ticket/54795 (2 months ago)

My apologies if this is a duplicate.

#4 @audrasjb
2 years ago

  • Milestone 5.9.3 deleted
Note: See TracTickets for help on using tickets.