From c5229b97b06a7cd486e3b9891f3f00787ea76975 Mon Sep 17 00:00:00 2001 From: Dean Sas Date: Fri, 24 Jan 2025 16:28:45 +0000 Subject: [PATCH 1/3] Display Copy quick action after quick editing CPTs After using quick edit to save a change the Copy quick action is no longer displayed. It works on posts but not on other CPTs, including pages. This change allows the Copy quick action on all CPTs. Related: https://github.com/Automattic/wp-calypso/issues/97995 --- projects/plugins/jetpack/modules/copy-post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); From b85f3b69a05432563aee9d4d85fb859bdc0b1994 Mon Sep 17 00:00:00 2001 From: Dean Sas Date: Mon, 27 Jan 2025 16:06:23 +0000 Subject: [PATCH 2/3] Display Blaze quick action after editing pages/products After using quick edit to save a change the Blaze quick action was no longer displayed. It works on posts but not on other CPTs, including pages. This change allows the Share with Blaze on all blaze-eligible CPTs after a quick-edit. Note that Blaze is only designed for posts, pages and products at present, nothing in this PR changes that. Related: https://github.com/Automattic/wp-calypso/issues/97995 --- projects/packages/blaze/src/class-blaze.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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. From 60bb8a7321e42dbb1d588ededf7890cd604bc576 Mon Sep 17 00:00:00 2001 From: Dean Sas Date: Mon, 27 Jan 2025 16:16:43 +0000 Subject: [PATCH 3/3] changelog --- projects/packages/blaze/changelog/fix-quickedit-blaze-cpt | 4 ++++ projects/plugins/jetpack/changelog/fix-quickedit-copy-cpt | 4 ++++ 2 files changed, 8 insertions(+) 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/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