title: JQuery each function not firing
body: <p>I am trying to setup multiple Tinymce textareas in the WordPress customizer. I've been trying to do this in the way explained here: <a href="https://aurooba.com/adding-tinymce-editor-in-wordpress-customizer/" rel="nofollow noreferrer">https://aurooba.com/adding-tinymce-editor-in-wordpress-customizer/</a></p>
  <p>However, it's not working for me,the text area displays normally with no tinymce so it seems to be a problem initialising it. My code is exactly as in that article. I have added alerts to the js to see what functions are firing when and I can see that the 'init' function is firing, but the tinyMCE_setup function is not, so maybe it's a problem with this line?</p>
  <pre><code>$( '.customize-control-tinymce-editor' ).each( tinyMCE_setup );
  </code></pre>
  <p>my jquery is:</p>
  <pre><code>(function ( $ ) {
  
  /**
   * TinyMCE Custom Control
   *
   * @author Aurooba Ahmed
   * @license http://www.gnu.org/licenses/gpl-2.0.html
   *
   */
   
  function tinyMCE_setup() {
  alert('setup');
      // Get the toolbar strings that were passed from the PHP Class
      var tinyMCEToolbar1 = _wpCustomizeSettings.controls[$( this ).attr( 'id' )].auroobamakes_tinymce_toolbar1;
  
      var tinyMCEToolbar2 = _wpCustomizeSettings.controls[$( this ).attr( 'id' )].auroobamakes_tinymce_toolbar2; // Get the media button condition passed from the PHP Class
  
  
      var tinyMCEMediaButtons = _wpCustomizeSettings.controls[$( this ).attr( 'id' )].auroobamakes_tinymce_mediabuttons; // Get the editor height passed from the PHP Class
  
  
      var tinyMCEheight = _wpCustomizeSettings.controls[$( this ).attr('id')].auroobamakes_tinymce_height; // Initialize editor with passed settings
  
      // initialize with unique ID (so you can have multiple) and with all the settings attributed correctly
      wp.editor.initialize( $( this ).attr( 'id' ), {
          
      tinymce: {
          toolbar: fontselect,
          toolbar1: tinyMCEToolbar1,
          toolbar2: tinyMCEToolbar2,
          height: tinyMCEheight
      },
      quicktags: true,
      mediaButtons: tinyMCEMediaButtons
      });
  }
  
  function initialize_tinyMCE(event, editor) {
      editor.on( 'change', function () {
      tinyMCE.triggerSave();
      $( &quot;#&quot;.concat( editor.id ) ).trigger( 'change' );
      });
  }
  
  function init() {
  alert('init');
          $( document ).on( 'tinymce-editor-init', initialize_tinyMCE );
  $( '.customize-control-tinymce-editor' ).each( tinyMCE_setup );
      }
      $( document) .on( 'ready', init );
    })( jQuery, wp.customize );
  </code></pre>
  <p>My php function is:</p>
  <pre><code>class AuroobaMakes_TinyMCE_Custom_Control extends WP_Customize_Control {
      /**
       * The type of control being rendered
       */
      public $type = 'tinymce_editor';
      /**
       * Enqueue our scripts and styles
       */
      public function enqueue() {
          wp_enqueue_editor();
  wp_enqueue_script('tinymcecontrol-js', get_template_directory_uri() . '/js/aurooba-makes-customizer-js.js', array('jquery'), 20220610, true );
          
      }
      /**
       * Pass our TinyMCE toolbar config to JavaScript
       */
      public function to_json() {
          parent::to_json();
  
          $this-&gt;json['auroobamakes_tinymce_toolbar1'] = isset( $this-&gt;input_attrs['toolbar1'] ) ? esc_attr( $this-&gt;input_attrs['toolbar1'] ) : 'bold italic bullist numlist alignleft aligncenter alignright link';
  
          $this-&gt;json['auroobamakes_tinymce_toolbar2'] = isset( $this-&gt;input_attrs['toolbar2'] ) ? esc_attr( $this-&gt;input_attrs['toolbar2'] ) : '';
  
          $this-&gt;json['auroobamakes_tinymce_mediabuttons'] = isset( $this-&gt;input_attrs['mediaButtons'] ) &amp;&amp; ( $this-&gt;input_attrs['mediaButtons'] === true ) ? true : false;
  
          $this-&gt;json['auroobamakes_tinymce_height'] = isset( $this-&gt;input_attrs['height'] ) ? esc_attr( $this-&gt;input_attrs['height'] ) : 200;
      }
      /**
       * Render the control in the customizer
       */
      public function render_content() {
          ?&gt;
          &lt;div class=&quot;tinymce-control&quot;&gt;
              &lt;span class=&quot;customize-control-title&quot;&gt;
                  &lt;?php echo esc_html( $this-&gt;label ); ?&gt;
              &lt;/span&gt;
  
              &lt;?php if ( ! empty( $this-&gt;description ) ) { ?&gt;
                  &lt;span class=&quot;customize-control-description&quot;&gt;
                      &lt;?php echo esc_html( $this-&gt;description ); ?&gt;
                  &lt;/span&gt;
              &lt;?php } ?&gt;
  
              &lt;textarea id=&quot;&lt;?php echo esc_attr( $this-&gt;id ); ?&gt;&quot; class=&quot;customize-control-tinymce-editor&quot; &lt;?php $this-&gt;link(); ?&gt;&gt;&lt;?php echo esc_attr( $this-&gt;value() ); ?&gt;&lt;/textarea&gt;
          &lt;/div&gt;
          &lt;?php
      }
      }
  </code></pre>