diff --git a/build/core/functions.php b/build/core/functions.php index 9f67473..bcca16c 100644 --- a/build/core/functions.php +++ b/build/core/functions.php @@ -576,5 +576,9 @@ function render_disable_tinymce_media_button( $hook_name, $label , $priority = 1 return $buttons; } ); + if ( get_option( "render_enable_tinymce_button_$hook_name" ) != 'enabled' ) { + remove_action( 'media_buttons', $hook_name, $priority ); + } + render_disable_tinymce_button( $hook_name, $label ); } \ No newline at end of file diff --git a/build/core/tinymce.php b/build/core/tinymce.php index 3454ce8..498566b 100644 --- a/build/core/tinymce.php +++ b/build/core/tinymce.php @@ -97,7 +97,6 @@ public static function remove_tinymce_buttons( $buttons ) { // Different method for media buttons if ( isset( $media_buttons[ $button_ID ] ) ) { - remove_action( 'media_buttons', $button_ID, $media_buttons[ $button_ID ] ); continue; }