paulund / wordpress-theme-customizer-custom-controls

A collection of custom controls you can use in your Wordpress theme customizer page
548 stars 161 forks source link

TinyMCE won't load on Text_Editor_Custom_Control #22

Open dbhynds opened 8 years ago

dbhynds commented 8 years ago

I've added a Text_Editor_Custom_Control to my Customizer using the code below. When I navigate to that section in the Customizer, the field appears with the "Add Media" button plus the "Visual" and "Text" tabs. However, the TinyMCE editor doesn't load. It doesn't add the editor buttons, and the input element itself remains a textarea, instead of being replaced by the iframe. There are no js errors in the console, nor are there any PHP errors (WP_DEBUG is set to 'true').

  $wp_customize->add_section( 'repeated_content' , array(
      'title'      => __( 'Repeated Content', 'sage' ),
  ) );
  $wp_customize->add_setting( 'scholarships' , array(
      'default'     => '',
      'transport'   => 'refresh',
  ) );
  $wp_customize->add_control( new Text_Editor_Custom_Control( $wp_customize, 'scholarships', array(
    'label'      => __( 'Scholarships', 'sage' ),
    'section'    => 'repeated_content',
    'settings'   => 'scholarships',
  ) ) );
Tomgroot commented 7 years ago

Have a look at: https://gist.github.com/Tabrisrp/13348dbcd2bbb0d9406f