Skip to content

Commit

Permalink
Fix deprecated dynamic properties
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Mar 7, 2024
1 parent 983adbf commit 08327e1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions inc/class-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
namespace richtext_extension;

class Options {
private $hook_suffix;

/**
* Settable font size range
*/
Expand All @@ -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',
Expand All @@ -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' ) );
}

/**
Expand Down Expand Up @@ -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'
);
}
Expand All @@ -214,7 +216,7 @@ public function create_options_page() {
<div id="poststuff">
<div id="post-body">
<div id="post-body-content">
<?php do_meta_boxes( $this->hook, 'normal', null ); ?>
<?php do_meta_boxes( $this->hook_suffix, 'normal', null ); ?>
<?php submit_button(); ?>
</div>
</div>
Expand All @@ -235,7 +237,7 @@ public function create_options_page() {

// Meta box
$( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' );
postboxes.add_postbox_toggles( '<?php echo $this->hook; ?>' );
postboxes.add_postbox_toggles( '<?php echo $this->hook_suffix; ?>' );

// Colorpicker
$( '.rtex-colorpicker' ).wpColorPicker( {
Expand Down

0 comments on commit 08327e1

Please sign in to comment.