Make WordPress Core

Opened 3 years ago

Last modified 2 months ago

#59562 new enhancement

edit_form_after_title Hook Not Functional in Block Editor on New Post Page.

Reported by: danishwebaashi's profile danishwebaashi Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3.2
Component: Editor Keywords: dev-feedback
Focuses: Cc:

Description

Hey Team,

We trying to add custom button before Post/Page Title, but it seems not working with Block Editor UI.

Please check the following bug report -

Problem: edit_form_after_title Hook Not Functional in Block Editor on New Post Page

Version: WordPress Latest Version of WordPress

Description:

Steps to Reproduce:

  1. Log in to your WordPress dashboard.
  2. Go to the "Posts" section.
  3. Click on "Add New" to create a new post.
  4. Ensure you are using the Block Editor (Gutenberg).

Expected Behavior:

The edit_form_after_title hook should work correctly in the Block Editor on the New Post page, just as it does in the Classic Editor.

Actual Behavior:

The edit_form_after_title hook is not functioning as expected in the Block Editor on the New Post page. However, it works fine in the Classic Editor.

Additional Information:

  • This issue is specific to the Block Editor.
  • The edit_form_after_title hook is crucial for developers who rely on it to add custom content or functionality after the post title in the editor.
  • It appears that this hook is not properly integrated or supported in the Block Editor on the New Post page.
  • This issue could be affecting a wide range of WordPress users and developers who are transitioning to the Block Editor.

Proposed Solution:

  1. Investigate and identify the root cause of the edit_form_after_title hook not working in the Block Editor on the New Post page.
  2. Provide a fix or workaround for this issue.
  3. Ensure that the Block Editor fully supports the edit_form_after_title hook, bringing it in line with the Classic Editor's functionality.
  4. Test the fix thoroughly to confirm that it resolves the problem without introducing new issues.

Impact:

This bug affects developers and users who rely on the edit_form_after_title hook to extend the WordPress editor's functionality. Failure to address this issue could lead to a suboptimal user experience and hinder the adoption of the Block Editor.

References:

Change History (3)

#1 @danishwebaashi
15 months ago

  • Component changed from Administration to Editor

#2 @danishwebaashi
15 months ago

  • Keywords needs-testing added

#3 @sajib1223
2 months ago

  • Keywords dev-feedback added; needs-testing removed
  • Type changed from defect (bug) to enhancement

edit_form_after_title is a classic editor PHP hook that fires within the post editing form rendered by edit-form-advanced.php. The Block Editor (Gutenberg) replaces that PHP-rendered form with a React-based JavaScript UI, so classic editor hooks like this one are not expected to fire.

This appears to be intended behavior rather than a bug. For extending the Block Editor, the recommended approach is to use the Block Editor's own extensibility APIs such as [SlotFills](https://developer.wordpress.org/block-editor/reference-guides/slotfills/) (e.g., PluginPostStatusInfo, PluginDocumentSettingPanel).

Changing type from defect to enhancement. Needs dev feedback on whether providing a Block Editor equivalent for this hook is something worth pursuing.

Note: See TracTickets for help on using tickets.