• How to set default text area or text in WordPress Customizer API.I am trying like this but not working for text and textarea. Please help.

    // Customizer section

    /* ======================== section Download button ===================== */
    	 $wp_customize->add_section('section_18', array(
    			 'title' => 'Download Button Title',
    			 'priority' => 22,
    			 'panel' => 'panel_1'
    	 ));
    
    	 /* ---------------------- setting and control ------------------ */
    	 $wp_customize->add_setting('download-button', array(
    			 'default'  => 'Test Data',
    			 'transport' => 'refresh'
    	 ));
    
    	 $wp_customize->add_control('download-button', array(
    			 'section' => 'section_18',
    			 'label' => 'Add Button Title',
    			 'type' => 'text'
    	 ));

    // Frontend
    <?php echo get_theme_mod(‘download-button’); ?>

    • This topic was modified 2 years, 5 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to set default text area or text in WordPress Customizer API’ is closed to new replies.