Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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