Fix filters for tinymce plugin

This commit is contained in:
Michael Thomas 2022-03-20 23:01:10 -04:00
parent 9662a50022
commit 3ea79e669c
1 changed files with 2 additions and 10 deletions

View File

@ -59,12 +59,6 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
add_action( $action, array( $this, $action ) ); 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 // Registers shortcodes
private function add_shortcodes( $shortcodes ) { private function add_shortcodes( $shortcodes ) {
foreach ( $shortcodes as $tag => $func ) foreach ( $shortcodes as $tag => $func )
@ -171,10 +165,8 @@ if ( !class_exists( 'CognitoFormsPlugin' ) ) {
// Initialize classic editor (TinyMCE) // Initialize classic editor (TinyMCE)
public function tinymce_init() { public function tinymce_init() {
if ( get_user_option( 'rich_editing' ) == 'true' ) { if ( get_user_option( 'rich_editing' ) == 'true' ) {
$this->add_filters( array( add_filter( 'mce_buttons', array( $this, 'tinymce_buttons' ) );
'tinymce_buttons', add_filter( 'mce_external_plugins', array( $this, 'tinymce_external_plugins' ) );
'tinymce_external_plugins'
) );
} }
} }