• I’ve been using the theme customizer API now for a few weeks and i think its a great interface to work with as a theme developer however i cant seem to find a way to export settings that are saved through the theme customizer. When i uninstall and reinstall my theme i have to set everything up again in the theme customizer.

    My question is, is there a way to import/export theme customizer options in WordPress? and if not, is there a free plugin that can accomplish this?

    Any input on this is greatly appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Even though this post is almost a year old, I hope this reply helps someone finding it on Google. I recently released a plugin for the WordPress Customizer that allows you to export or import your settings. Full details here… https://wordpress.org/plugins/customizer-export-import/

    Justin

    Thread Starter Pulsar_Media

    (@pulsar_media)

    Hi Justin,

    Thanks for the reply. I tested your plugin and it works pretty good however i cant seem to get my color fields to export. My color fields are being saved with the “option” type and i implemented the filter code you have listed on your plugin page but it doesn’t seem to be working.

    Here is my filter code:

    add_filter( 'cei_export_option_keys', 'pm_ln_export_option_keys' );
    
    function pm_ln_export_option_keys( $keys ) {
        $keys[] = 'mainNavColor';
        $keys[] = 'mainNavBorderColor';
        return $keys;
    }

    and here is a sample code i am using to create my color fields:

    $headerOptionColors[] = array(
    			'slug'=>'loginButtonColor',
    			'default' => '#6cb9f3',
    			'label' => __('Login / Search / Account Button Color', 'quantumtheme')
    		);
    $headerOptionColors[] = array(
    			'slug'=>'loginButtonBorderColor',
    			'default' => '#0a8bec',
    			'label' => __('Login / Search / Account Border Color', 'quantumtheme')
    		);
    
    foreach( $headerOptionColors as $color ) {
    
    			// SETTINGS
    			$wp_customize->add_setting(
    				$color['slug'], array(
    					'default' => $color['default'],
    					'type' => 'option',
    					'capability' => 'edit_theme_options'
    				)
    			);
    			// CONTROLS
    			$wp_customize->add_control(
    				new WP_Customize_Color_Control(
    					$wp_customize,
    					$color['slug'],
    					array(
    						'label' => $color['label'],
    						'section' => 'header_options',
    						'priority' => $priorityHeaderColors,
    						'settings' => $color['slug']
    					)
    				)
    			);

    Any help on getting this to work would be appreciated.

    Thanks.

    Thread Starter Pulsar_Media

    (@pulsar_media)

    Nevermind, it works.

    Great plugin…good job :]

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Theme Customizer Export?’ is closed to new replies.