From 618b702733756953e05bde03c400dc3ca9044ea5 Mon Sep 17 00:00:00 2001 From: Osk Date: Wed, 11 Sep 2024 03:24:25 -0300 Subject: [PATCH] Social: Call Publicize_UI::init on admin_init instead of on init (#39342) * Call Publicize_UI::init on admin_init * changelog --- .../changelog/update-publicize-ui-init-on-admin-only | 4 ++++ projects/packages/publicize/src/class-publicize-ui.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 projects/packages/publicize/changelog/update-publicize-ui-init-on-admin-only diff --git a/projects/packages/publicize/changelog/update-publicize-ui-init-on-admin-only b/projects/packages/publicize/changelog/update-publicize-ui-init-on-admin-only new file mode 100644 index 0000000000000..ab5c5069aacb4 --- /dev/null +++ b/projects/packages/publicize/changelog/update-publicize-ui-init-on-admin-only @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Moved initialization of Publicize UI from init action to admin_init action diff --git a/projects/packages/publicize/src/class-publicize-ui.php b/projects/packages/publicize/src/class-publicize-ui.php index a478d88894105..ccb307783bf85 100644 --- a/projects/packages/publicize/src/class-publicize-ui.php +++ b/projects/packages/publicize/src/class-publicize-ui.php @@ -38,7 +38,7 @@ public function __construct() { } $this->publicize = $publicize; - add_action( 'init', array( $this, 'init' ) ); + add_action( 'admin_init', array( $this, 'init' ) ); } /**