Site editor: update custom post types with _edit_link #50563
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Resolves: #48065
Hello!
This PR backports the following functionality from Core:
_edit_link
property towp_global_styles
,wp_template
, andwp_template-part
custom post type schemata via filter_edit_link
value to create an edit link via theget_edit_post_link
hookWhy?
A revisions link was added to view revisions for templates and template parts.
This link takes the user to the WordPress
revision.php
screen. Here there are two links that should link back to the editor.But since the custom post types schemata did not contain an
_edit_link
property, the links were broken.wp_global_styles
was covered for the sake of completion.This was recently fixed in Core and already has test coverage:
But 6.3 won't be out until later in the year. August?
How?
register_post_type_args
andget_edit_post_link filters
Testing Instructions
revision.php
. Now make sure that the two links, e.g., Compare Revisions of “header” and ← Go to editor take you back to the site editor with the right template in edit mode.