Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore gutenberg_add_edit_link_for_post_type filter. #3159

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function gutenberg_init( $return, $post ) {
return false;
}

if ( ! post_type_supports( $post_type, 'editor' ) ) {
if ( ! post_type_supports( $post_type, 'editor' ) || ! apply_filters( 'gutenberg_add_edit_link_for_post_type', true, $post_type, $post ) ) {
return false;
}

Expand Down Expand Up @@ -349,7 +349,8 @@ function gutenberg_add_edit_link_filters() {
* @return array Updated post actions.
*/
function gutenberg_add_edit_link( $actions, $post ) {
if ( 'trash' === $post->post_status || ! post_type_supports( $post->post_type, 'editor' ) ) {
$post_type_supported = post_type_supports( $post->post_type, 'editor' ) && apply_filters( 'gutenberg_add_edit_link_for_post_type', true, $post->post_type, $post );
if ( 'trash' === $post->post_status || ! $post_type_supported ) {
return $actions;
}

Expand Down