Skip to content

Commit

Permalink
Delay calling is_using_gutenberg until `use_block_editor_for_post_t…
Browse files Browse the repository at this point in the history
…ype` is defined.
  • Loading branch information
peterwilsoncc committed Aug 17, 2022
1 parent ba86310 commit 2a7eed0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions includes/syndicated-post-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Distributor\SyndicatedPostUI;

use Distributor\Utils;

/**
* Setup actions and filters
*
Expand All @@ -26,12 +28,8 @@ function() {
add_filter( 'admin_body_class', __NAMESPACE__ . '\add_linked_class' );
add_filter( 'post_row_actions', __NAMESPACE__ . '\remove_quick_edit', 10, 2 );

$post = isset( $_GET['post'] ) ? get_post( (int) $_GET['post'] ) : false; // @codingStandardsIgnoreLine Nonce not required

if ( $post && ! \Distributor\Utils\is_using_gutenberg( $post ) ) {
add_action( 'do_meta_boxes', __NAMESPACE__ . '\replace_revisions_meta_box', 10, 3 );
add_action( 'add_meta_boxes', __NAMESPACE__ . '\add_revisions_meta_box' );
}
add_action( 'do_meta_boxes', __NAMESPACE__ . '\replace_revisions_meta_box', 10, 3 );
add_action( 'add_meta_boxes', __NAMESPACE__ . '\add_revisions_meta_box' );

add_action( 'admin_init', __NAMESPACE__ . '\setup_columns' );
}
Expand Down Expand Up @@ -256,6 +254,10 @@ function replace_revisions_meta_box( $post_type, $context, $post ) {
return;
}

if ( Utils\is_using_gutenberg( $post ) ) {
return;
}

$original_blog_id = get_post_meta( $post->ID, 'dt_original_blog_id', true );
$original_post_id = get_post_meta( $post->ID, 'dt_original_post_id', true );
$original_source_id = get_post_meta( $post->ID, 'dt_original_source_id', true );
Expand Down

0 comments on commit 2a7eed0

Please sign in to comment.