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: |
|
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:
- Log in to your WordPress dashboard.
- Go to the "Posts" section.
- Click on "Add New" to create a new post.
- 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_titlehook 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:
- Investigate and identify the root cause of the
edit_form_after_titlehook not working in the Block Editor on the New Post page. - Provide a fix or workaround for this issue.
- Ensure that the Block Editor fully supports the
edit_form_after_titlehook, bringing it in line with the Classic Editor's functionality. - 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:
- [WordPress Plugin Handbook - edit_form_after_title Hook](https://developer.wordpress.org/reference/hooks/edit_form_after_title/)
- [Gutenberg Handbook - Block Editor Overview](https://developer.wordpress.org/block-editor/)
edit_form_after_titleis a classic editor PHP hook that fires within the post editing form rendered byedit-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.