From 13838d903f47192033662fe0cb4e8a6f8505011d Mon Sep 17 00:00:00 2001 From: Dean Sas Date: Tue, 28 Jan 2025 17:52:57 +0000 Subject: [PATCH] Fix copy/blaze quick links disappearing after quick edit (#41339) --- projects/packages/blaze/changelog/fix-quickedit-blaze-cpt | 4 ++++ projects/packages/blaze/src/class-blaze.php | 4 +++- projects/plugins/jetpack/changelog/fix-quickedit-copy-cpt | 4 ++++ projects/plugins/jetpack/modules/copy-post.php | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 projects/packages/blaze/changelog/fix-quickedit-blaze-cpt create mode 100644 projects/plugins/jetpack/changelog/fix-quickedit-copy-cpt diff --git a/projects/packages/blaze/changelog/fix-quickedit-blaze-cpt b/projects/packages/blaze/changelog/fix-quickedit-blaze-cpt new file mode 100644 index 0000000000000..bf93098e4878c --- /dev/null +++ b/projects/packages/blaze/changelog/fix-quickedit-blaze-cpt @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Blaze: Ensure Blaze still available after quick edit in post list diff --git a/projects/packages/blaze/src/class-blaze.php b/projects/packages/blaze/src/class-blaze.php index dff0ef06aeecb..fed2e40818f03 100644 --- a/projects/packages/blaze/src/class-blaze.php +++ b/projects/packages/blaze/src/class-blaze.php @@ -46,7 +46,9 @@ public static function init() { // On the edit screen, add a row action to promote the post. add_action( 'load-edit.php', array( __CLASS__, 'add_post_links_actions' ) ); // After the quick-edit screen is processed, ensure the blaze row action is still present - if ( 'admin-ajax.php' === $GLOBALS['pagenow'] && ! empty( $_POST['screen'] ) && 'edit-post' === $_POST['screen'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verification is not needed here, we're not saving anything. + if ( 'edit.php' === $GLOBALS['pagenow'] || + // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verification is not needed here, we're not saving anything. + ( 'admin-ajax.php' === $GLOBALS['pagenow'] && ! empty( $_POST['post_view'] ) && 'list' === $_POST['post_view'] && ! empty( $_POST['action'] ) && 'inline-save' === $_POST['action'] ) ) { self::add_post_links_actions(); } // In the post editor, add a post-publish panel to allow promoting the post. diff --git a/projects/plugins/jetpack/changelog/fix-quickedit-copy-cpt b/projects/plugins/jetpack/changelog/fix-quickedit-copy-cpt new file mode 100644 index 0000000000000..25fc3474dd4c5 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-quickedit-copy-cpt @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Copy Post: Ensure Copy still available after quick edit in post list on all CPTs diff --git a/projects/plugins/jetpack/modules/copy-post.php b/projects/plugins/jetpack/modules/copy-post.php index 85512f024a347..38afc654a5a24 100644 --- a/projects/plugins/jetpack/modules/copy-post.php +++ b/projects/plugins/jetpack/modules/copy-post.php @@ -29,7 +29,7 @@ class Jetpack_Copy_Post { * @return void */ public function __construct() { - if ( 'edit.php' === $GLOBALS['pagenow'] || ( 'admin-ajax.php' === $GLOBALS['pagenow'] && ! empty( $_POST['screen'] ) && 'edit-post' === $_POST['screen'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- update_post_data() handles access check. + if ( 'edit.php' === $GLOBALS['pagenow'] || ( 'admin-ajax.php' === $GLOBALS['pagenow'] && ! empty( $_POST['post_view'] ) && 'list' === $_POST['post_view'] && ! empty( $_POST['action'] ) && 'inline-save' === $_POST['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- update_post_data() handles access check. add_action( 'admin_head', array( $this, 'print_inline_styles' ) ); add_filter( 'post_row_actions', array( $this, 'add_row_action' ), 10, 2 ); add_filter( 'page_row_actions', array( $this, 'add_row_action' ), 10, 2 );