Skip to content

Hooks: add_action() used for use_block_editor_for_post_type filter #32

@apermo

Description

@apermo

Problem

In wp-admin/includes/admin-filters.php at line 88, add_action() is used to register a callback on the use_block_editor_for_post_type hook, but this hook is fired with apply_filters() — making it a filter, not an action.

add_action( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );

Where the hook fires

  • src/wp-includes/post.php:8646apply_filters( 'use_block_editor_for_post_type', ... )

The PHPDoc at line 8643 clearly documents this as a filter with @param tags for return value filtering.

Fix

Change add_action() to add_filter().

Related to https://core.trac.wordpress.org/ticket/64224

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhas-fixHas a fix/PR upstream is openedverifiedIssue is manually verified.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions