From 711689718d94ef33b9c236f9af503162075692e8 Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 13 Mar 2026 09:14:34 +0200 Subject: [PATCH 1/4] Remove legacy polldaddy plugin feedback menu creation code. The polldaddy plugin integration for creating the Feedback menu item is no longer needed and has been removed from the admin_menu() function. --- .../forms/changelog/remove-polldaddy-feedback-menu | 4 ++++ .../src/contact-form/class-contact-form-plugin.php | 14 -------------- 2 files changed, 4 insertions(+), 14 deletions(-) create mode 100644 projects/packages/forms/changelog/remove-polldaddy-feedback-menu diff --git a/projects/packages/forms/changelog/remove-polldaddy-feedback-menu b/projects/packages/forms/changelog/remove-polldaddy-feedback-menu new file mode 100644 index 000000000000..efe6367cace3 --- /dev/null +++ b/projects/packages/forms/changelog/remove-polldaddy-feedback-menu @@ -0,0 +1,4 @@ +Significance: patch +Type: removed + +Remove legacy polldaddy plugin feedback menu creation code. diff --git a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php index 226502f7682e..c9cafa7bfda8 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php +++ b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php @@ -1479,20 +1479,6 @@ public static function gutenblock_render_field_image_select( $atts, $content, $b public function admin_menu() { $slug = 'feedback'; - // Do we still need to create the Feedback menu item for polldaddy? - // WPCOM already handles this. Self hosted will depend on us until we produce a new release for polldaddy. - if ( is_plugin_active( 'polldaddy/polldaddy.php' ) || ! Jetpack_Forms::is_legacy_menu_item_retired() ) { - add_menu_page( - __( 'Feedback', 'jetpack-forms' ), - __( 'Feedback', 'jetpack-forms' ), - 'edit_pages', - $slug, - null, - 'dashicons-feedback', - 45 - ); - } - add_submenu_page( $slug, __( 'Form Responses', 'jetpack-forms' ), From 000a7319c09f61f7d5c7236ef66f00abcfa5b856 Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 13 Mar 2026 09:20:43 +0200 Subject: [PATCH 2/4] Remove entire admin_menu() function and its hook. Removes the admin_menu() function completely along with its hook registration, as the feedback menu management is no longer needed. --- .../class-contact-form-plugin.php | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php index c9cafa7bfda8..398b98c08396 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php +++ b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php @@ -236,7 +236,6 @@ protected function __construct() { add_action( 'wp_ajax_create_new_form', array( $this, 'create_new_form' ) ); add_action( 'wp_ajax_grunion_export_to_gdrive', array( $this, 'export_to_gdrive' ) ); } - add_action( 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'current_screen', array( $this, 'unread_count' ) ); add_action( 'current_screen', array( $this, 'redirect_edit_feedback_to_jetpack_forms' ) ); @@ -1473,34 +1472,6 @@ public static function gutenblock_render_field_image_select( $atts, $content, $b return Contact_Form::parse_contact_field( $atts, $content, $block ); } - /** - * Add the 'Form Responses' menu item as a submenu of Feedback. - */ - public function admin_menu() { - $slug = 'feedback'; - - add_submenu_page( - $slug, - __( 'Form Responses', 'jetpack-forms' ), - __( 'Form Responses', 'jetpack-forms' ), - 'edit_pages', - 'edit.php?post_type=feedback', - null, - 0 - ); - - remove_submenu_page( - $slug, - $slug - ); - - // remove the first default submenu item - remove_submenu_page( - $slug, - 'edit.php?post_type=feedback' - ); - } - /** * Add to REST API post type allowed list. * From 4fbf99d3a1d50368f13d29ec05886b494acd783f Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 13 Mar 2026 09:23:11 +0200 Subject: [PATCH 3/4] Deprecate admin_menu() function instead of removing. The function now contains only a deprecation notice, keeping backward compatibility while indicating the functionality is no longer needed. --- .../forms/changelog/remove-polldaddy-feedback-menu | 4 ++-- .../src/contact-form/class-contact-form-plugin.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/projects/packages/forms/changelog/remove-polldaddy-feedback-menu b/projects/packages/forms/changelog/remove-polldaddy-feedback-menu index efe6367cace3..4f3b87d12c4e 100644 --- a/projects/packages/forms/changelog/remove-polldaddy-feedback-menu +++ b/projects/packages/forms/changelog/remove-polldaddy-feedback-menu @@ -1,4 +1,4 @@ Significance: patch -Type: removed +Type: deprecated -Remove legacy polldaddy plugin feedback menu creation code. +Deprecate admin_menu() function as feedback menu management is no longer needed. diff --git a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php index 398b98c08396..3e6d1c82c569 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php +++ b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php @@ -236,6 +236,7 @@ protected function __construct() { add_action( 'wp_ajax_create_new_form', array( $this, 'create_new_form' ) ); add_action( 'wp_ajax_grunion_export_to_gdrive', array( $this, 'export_to_gdrive' ) ); } + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'current_screen', array( $this, 'unread_count' ) ); add_action( 'current_screen', array( $this, 'redirect_edit_feedback_to_jetpack_forms' ) ); @@ -1472,6 +1473,15 @@ public static function gutenblock_render_field_image_select( $atts, $content, $b return Contact_Form::parse_contact_field( $atts, $content, $block ); } + /** + * Add the 'Form Responses' menu item as a submenu of Feedback. + * + * @deprecated $$next-version$$ + */ + public function admin_menu() { + _deprecated_function( __METHOD__, 'jetpack-forms-$$next-version$$' ); + } + /** * Add to REST API post type allowed list. * From 43ff9fb72937e3de0d68e09421f085a3cb85eb22 Mon Sep 17 00:00:00 2001 From: Mikael Korpela Date: Fri, 13 Mar 2026 09:23:30 +0200 Subject: [PATCH 4/4] Remove admin_menu hook registration. The deprecated admin_menu() function should not be hooked to prevent it from being called. --- .../forms/src/contact-form/class-contact-form-plugin.php | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php index 3e6d1c82c569..6e5e976675c4 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form-plugin.php +++ b/projects/packages/forms/src/contact-form/class-contact-form-plugin.php @@ -236,7 +236,6 @@ protected function __construct() { add_action( 'wp_ajax_create_new_form', array( $this, 'create_new_form' ) ); add_action( 'wp_ajax_grunion_export_to_gdrive', array( $this, 'export_to_gdrive' ) ); } - add_action( 'admin_menu', array( $this, 'admin_menu' ) ); add_action( 'current_screen', array( $this, 'unread_count' ) ); add_action( 'current_screen', array( $this, 'redirect_edit_feedback_to_jetpack_forms' ) );