From 08327e1971feaf0bca5d5ba2800b8d2b406083a4 Mon Sep 17 00:00:00 2001 From: Tetsuaki Hamano Date: Thu, 7 Mar 2024 22:21:24 +0900 Subject: [PATCH] Fix deprecated dynamic properties --- inc/class-options.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/inc/class-options.php b/inc/class-options.php index 1886041..382637b 100644 --- a/inc/class-options.php +++ b/inc/class-options.php @@ -8,6 +8,8 @@ namespace richtext_extension; class Options { + private $hook_suffix; + /** * Settable font size range */ @@ -29,7 +31,7 @@ public function __construct() { * Add option page */ public function add_options_page() { - $this->hook = add_options_page( + $this->hook_suffix = add_options_page( __( 'RichText Extension Setting', 'richtext-extension' ), __( 'RichText Extension', 'richtext-extension' ), 'manage_options', @@ -38,7 +40,7 @@ public function add_options_page() { ); //Load javascript to allow drag/drop, expand/collapse of metaboxes - add_action( 'load-' . $this->hook, array( $this, 'load_postbox' ) ); + add_action( 'load-' . $this->hook_suffix, array( $this, 'load_postbox' ) ); } /** @@ -189,7 +191,7 @@ public function create_meta_boxes() { 'rtex-metabox-' . $meta_box['slug'], $meta_box['label'], array( $this, 'metabox_' . $meta_box['slug'] ), - $this->hook, + $this->hook_suffix, 'normal' ); } @@ -214,7 +216,7 @@ public function create_options_page() {
- hook, 'normal', null ); ?> + hook_suffix, 'normal', null ); ?>
@@ -235,7 +237,7 @@ public function create_options_page() { // Meta box $( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' ); - postboxes.add_postbox_toggles( 'hook; ?>' ); + postboxes.add_postbox_toggles( 'hook_suffix; ?>' ); // Colorpicker $( '.rtex-colorpicker' ).wpColorPicker( {