Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Formation_customizer_child($wp_customize) {
- //Add the texteditor option for wp_customize
- class Customize_Text_Editor_Control extends WP_Customize_Control {
- public function render_content() {
- ?>
- <span class="customize-control-title"><?php echo esc_html($this->label); ?></span>
- <?php
- $settings = array(
- 'textarea_name' => $this->id,
- 'media_buttons' => false,
- 'teeny' => true
- );
- wp_editor($this->value(), $this->id, $settings);
- }
- }
- $wp_customize->add_section('featured_section_top_child', array(
- 'title' => __('Featured Text Area', 'Formation'),
- 'description' => __('This is a settings section to change the homepage featured text area.', 'Formation'),
- 'priority' => 195
- )
- );
- $wp_customize->add_setting(
- 'featured_texteditor', array(
- 'default' => '',
- )
- );
- $wp_customize->add_control( new Customize_Text_Editor_Control( $wp_customize,
- 'featured_texteditor', array(
- 'label' => __('Featured Text Header', 'Formation'),
- 'section' => 'featured_section_top_child',
- 'settings' => 'featured_texteditor',
- )
- ));
- $wp_customize->add_setting('featured_button_url_child');
- $wp_customize->add_control(
- 'featured_button_url_child', array(
- 'label' => __('Featured Button URL', 'Formation'),
- 'section' => 'featured_section_top_child',
- 'type' => 'text',
- )
- );
- }
- add_action('customize_register', 'Formation_customizer_child');
- //Remove parent theme featured text box
- function run_after_setup(){
- remove_action('customize_register', 'Formation_customizer');
- }
- add_action('after_setup_theme', 'run_after_setup');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement