CommunityCategory: SIP Advanced Email Rules for WooCommerceText area for email text not working on page "Edit Advanced email notification": javascript error
Robert asked 4 months ago

I get an javascript error when I switch between “Visual” and “Text” mode and the entire text area is disappearing. When I “Delete” the text area and then adding a new one, it works.
But after saving the email notification, the text is gone and the editor empty again.
This is the error:
Uncaught TypeError: Cannot read property ‘push’ of undefined at t.(/wp-admin/anonymous function).t.(anonymous function).createMenuValues (https://staging.crowdlauf.de/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/js/avia-tinymce-buttons-4.js?wp-mce-4920-20181217:93:28) at t.(/wp-admin/anonymous function).t.(anonymous function).init (https://staging.crowdlauf.de/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/js/avia-tinymce-buttons-4.js?wp-mce-4920-20181217:23:26) at Jx (VM5658 tinymce.min.js:2) at Array. (VM5658 tinymce.min.js:2) at Object.Ht [as each] (VM5658 tinymce.min.js:2) at nw (VM5658 tinymce.min.js:2) at Aw. (VM5658 tinymce.min.js:2) at Array. (VM5658 tinymce.min.js:2) at Ht (VM5658 tinymce.min.js:2) at u (VM5658 tinymce.min.js:2)
I use WordPress 5.x with popular Enfold Theme which has “Avia Builder” as Layout Builder.
Like this, the plugin is useless. Please help.
Thanks in advance,
Robert

Robert replied 4 months ago

SIP – 1.1.7
Wordpress – 5.1.1
Woocommerce – 3.5.7

2 Answers
Hafiz Muhammad Usman Staff answered 4 months ago

Hi Robert,
That issue is not occur on our end and that is occur from your theme. can you give me theme so i can check on my end.

Robert answered 4 months ago

Hi Hafiz,
I asked my theme support and now got an answer, how you can deregister the tinymce script of enfold theme.

// disable tiny mce button
function avf_remove_tinyMCE_button( $plugins ) {
    if ( 'post_type_name' == get_post_type() ) {
        unset($plugins['avia_builder_button']);
    }

    return $plugins;
}
add_filter( 'mce_external_plugins', 'avf_remove_tinyMCE_button', 999, 1 );

I hope that you are now able to find a solution. Thanks in advance!
Robert

Robert replied 4 months ago

You have to put in your specific post type ID instead of “post_type_name”, for sure 🙂

Hafiz Muhammad Usman Staff replied 4 months ago

let me check.

Hafiz Muhammad Usman Staff replied 4 months ago

Please insert that code at the end of functions.php file

// disable tiny mce button 
function avf_remove_tinyMCE_button( $plugins ) {
      if ( 'a_e_n_shop' == get_post_type() ) {
             unset($plugins['avia_builder_button']);
      }
      return $plugins;
}
add_filter( 'mce_external_plugins', 'avf_remove_tinyMCE_button', 999, 1 );

Given below is the example

Robert replied 3 months ago

It works now! Thank you very much!