Skip to content

Instantly share code, notes, and snippets.

@Tabrisrp
Created April 14, 2015 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Tabrisrp/d81457723533c5ebcbce to your computer and use it in GitHub Desktop.
Save Tabrisrp/d81457723533c5ebcbce to your computer and use it in GitHub Desktop.
WordPress customizer_register TinyMCE control
function register_theme_customizer() {
$wp_customize->add_section( 'editor', array(
'title' => 'Editeur',
'description' => 'Editeur TinyMCE',
'priority' => 300
) );
$wp_customize->add_setting( 'theme[editor_content]', array(
'default' => '',
'transport' => 'postMessage',
'sanitize_callback' => 'wp_kses_post'
) );
$wp_customize->add_control( new Text_Editor_Custom_Control( $wp_customize, 'editor_content', array(
'label' => 'Contenu',
'section' => 'editor',
'settings' => 'cornettes[editor_content]',
'type' => 'textarea'
) ) );
}
add_action ( 'customize_register', 'register_theme_customizer' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment