Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter SoulOnFire

    (@soulonfire)

    Okay, I have managed to go so far using the information from the Codex:
    1) I have added the plugin and the button

    <?php
    /*
    Plugin Name: TinyMCE Template Plugin
    */
    
    /* Add the TinyMCE Template Plugin */
    add_filter('mce_external_plugins', 'my_custom_plugins');
    
    function my_custom_plugins () {
         $plugins = array('template'); //Add any more plugins you want to load here
         $plugins_array = array();
    
         //Build the response - the key is the plugin name, value is the URL to the plugin JS
         foreach ($plugins as $plugin ) {
              $plugins_array[ $plugin ] = plugins_url('tinymce/plugins/', __FILE__) . $plugin . '/plugin.min.js';
         }
         return $plugins_array;
    }
    
    function myplugin_tinymce_buttons($buttons)
     {
          //Add style selector to the beginning of the toolbar
          array_unshift($buttons, 'template');
    
          return $buttons;
     }
    add_filter('mce_buttons','myplugin_tinymce_buttons');
    ?>

    2) I have set up a template file and the following code:

    tinymce.init({
        plugins: "template",
        toolbar: "template",
        templates : "/templates/templates.php"
    });

    However, now I have the following error with the plugin.min.js file:
    ‘TypeError: e.notificationManager is undefined’

    I am going out of my mind with this and I have no idea what I am doing wrong. Am I missing something? Any help will be appreciated.

    Thread Starter SoulOnFire

    (@soulonfire)

    Okay, I just found out more information. As it turns out the problem is that some products are part of several categories. A product is shown only in one category. I can’t figure out how the category is chosen.

    So for example if I have a chair in both ‘work chairs’ and in ‘management chairs’, it will be shown only in work chairs. The answer might be pretty obvious but I am still fairly new to programming and to WordPress and I can’t figure it out.

Viewing 2 replies - 1 through 2 (of 2 total)