From 328ff6b87e0f1b19e1e4732b78a75a1fa279c48d Mon Sep 17 00:00:00 2001 From: sergeymitr Date: Thu, 5 Dec 2024 13:50:59 +0000 Subject: [PATCH] Jetpack: remove deprecated hooks and methods on Jetpack admin pages (#40457) Get rid of excessive `jetpack_loaded` hook callbacks by methods and properties deprecated in Jetpack 13.9 Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12180859198 Upstream-Ref: Automattic/jetpack@f86bb18d6a904a90908def314671e23de2209d69 --- CHANGELOG.md | 1 + .../admin-pages/class.jetpack-admin-page.php | 39 ------------------- class.jetpack.php | 10 ----- 3 files changed, 1 insertion(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e6e8f07fb..20cea4d4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ This is an alpha version! The changes listed here are not final. - Jetpack AI: remove dead and deprecated code - Newsletter sidebar: fix no space under toggle - register_block_metadata_collection: Silence path validation notices +- Remove deprecated hooks and methods on Jetpack admin pages. - Testing: Remove old instructions. - Updated package dependencies. diff --git a/_inc/lib/admin-pages/class.jetpack-admin-page.php b/_inc/lib/admin-pages/class.jetpack-admin-page.php index 9e4f739dab..d2cfcc319d 100644 --- a/_inc/lib/admin-pages/class.jetpack-admin-page.php +++ b/_inc/lib/admin-pages/class.jetpack-admin-page.php @@ -14,14 +14,6 @@ * Shared logic between Jetpack admin pages. */ abstract class Jetpack_Admin_Page { - /** - * Jetpack Object. - * - * @var Jetpack - * @deprecated 13.9 Use `Jetpack::init()` instead. - */ - public $jetpack; - /** * Add page specific actions given the page hook. * @@ -53,30 +45,6 @@ abstract public function page_render(); */ public function additional_styles() {} - /** - * The constructor. - */ - public function __construct() { - /** - * Keeping it for backward compatibility in case the `$jetpack` property is still in use. - * To be removed. - * - * @deprecated 13.9 - */ - add_action( 'jetpack_loaded', array( $this, 'on_jetpack_loaded' ) ); - } - - /** - * Runs on Jetpack being ready to load its packages. - * - * @deprecated 13.9 - * - * @param Jetpack $jetpack object. - */ - public function on_jetpack_loaded( $jetpack ) { - $this->jetpack = $jetpack; - } - /** * Add common page actions and attach page-specific actions. */ @@ -142,13 +110,6 @@ public function render() { self::wrap_ui( array( $this, 'page_render' ), $args ); } - /** - * Doesn't do anything anymore. - * - * @deprecated 13.9 No longer used. - */ - public function admin_help() {} - /** * Call the existing admin page events. */ diff --git a/class.jetpack.php b/class.jetpack.php index 3f83242474..93da10782e 100644 --- a/class.jetpack.php +++ b/class.jetpack.php @@ -3487,16 +3487,6 @@ public function upload_handler( $update_media_item = false ) { return $uploaded_files; } - /** - * Doesn't do anything anymore. - * - * @deprecated 13.9 We no longer show the "Help" button. - * - * @since Jetpack (1.2.3) - * @return void - */ - public function admin_help() {} - /** * Add action links for the Jetpack plugin. *