[wp-trac] [WordPress Trac] #63382: No hooks to load custom Post Editor
WordPress Trac
noreply at wordpress.org
Tue May 6 06:55:29 UTC 2025
#63382: No hooks to load custom Post Editor
-------------------------------+------------------------------
Reporter: ignatiusjeroe | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version:
Severity: minor | Resolution:
Keywords: 2nd-opinion close | Focuses: administration
-------------------------------+------------------------------
Comment (by ignatiusjeroe):
Replying to [comment:1 swissspidy]:
> > This leads me to believe that the team insists any custom editor be
loaded with JS script.
>
> No, the idea is to require your custom PHP code and then return true in
the filter. See this example:
>
> https://github.com/GoogleForCreators/web-stories-
wp/blob/5ca9ff4043990a3f736ace1b83c28cfc705ad24c/includes/Admin/Editor.php#L234-L258
>
> And the included file:
>
> https://github.com/GoogleForCreators/web-stories-
wp/blob/5ca9ff4043990a3f736ace1b83c28cfc705ad24c/includes/templates/admin
/edit-story.php
>
> As someone who built such a custom editor, the current solution works
fine and I don't see the need to add 3 extra hooks for that.
What you are proposing with your approach is to load your custom editor in
a callback function registered to filter 'replace_editor' and then to
return true. You might not be aware of it, but performing other tasks than
the action or filter hook was intended for, is called side-effect. This
goes against coding standards. In practice you can apply your approach but
it is a bad practice. Awaiting a response.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63382#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list