From 3ea79e669c9ebfe0689ac4db1284b47ad7ce9d28 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Sun, 20 Mar 2022 23:01:10 -0400 Subject: [PATCH] Fix filters for tinymce plugin --- cognito-forms.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cognito-forms.php b/cognito-forms.php index 056d639..6ade6df 100644 --- a/cognito-forms.php +++ b/cognito-forms.php @@ -59,12 +59,6 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) { add_action( $action, array( $this, $action ) ); } - // Registers plug-in filters - private function add_filters( $filters ) { - foreach ( $filters as $filter ) - add_filter( $filter, array( $this, $filter ) ); - } - // Registers shortcodes private function add_shortcodes( $shortcodes ) { foreach ( $shortcodes as $tag => $func ) @@ -171,10 +165,8 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) { // Initialize classic editor (TinyMCE) public function tinymce_init() { if ( get_user_option( 'rich_editing' ) == 'true' ) { - $this->add_filters( array( - 'tinymce_buttons', - 'tinymce_external_plugins' - ) ); + add_filter( 'mce_buttons', array( $this, 'tinymce_buttons' ) ); + add_filter( 'mce_external_plugins', array( $this, 'tinymce_external_plugins' ) ); } }