Coder Social home page Coder Social logo

pross / customizer-export-import Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fastlinemedia/customizer-export-import

0.0 2.0 0.0 38 KB

Adds a settings export/import section to the WordPress customizer.

PHP 91.70% CSS 2.63% JavaScript 5.67%

customizer-export-import's Introduction

Customizer Export/Import

The Customizer Export/Import plugin allows you to export or import your WordPress customizer settings from directly within the customizer interface! If your theme makes use of the WordPress customizer for its settings, this plugin is for you!

Please visit our blog for more info on the Customizer Export/Import plugin.

New! Export Options!

The Customizer Export/Import plugin previously only exported options saved as theme mods using the get_theme_mods function, but that is no more! The Customizer Export/Import plugin now exports settings saved as options as well!

How It Works

Exporting customizer settings is easy. Click the export button from within the customizer and a file will automatically begin downloading with your settings. Export files are named after your theme and can only be used to import settings for the theme or child theme that they came from. Export files contain a serialized dump of mods retrieved using the get_theme_mods function or customizer settings saved as options.

Importing customizer settings is just as easy. Choose the export file you would like to import, select whether you would like to download and import images (similar to importing posts), and finally, click the import button. Once your settings have been imported the page will refresh and your new design will be displayed.

Exporting Custom Options

Developers can also have arbitrary options that aren't part of the customizer exported by using the cei_export_option_keys filter. Those options can be exported and imported by adding your option key to the array of options that will be exported as shown below.

function my_export_option_keys( $keys ) {
	$keys[] = 'my_option_key';
	$keys[] = 'another_option_key';
	return $keys;
}

add_filter( 'cei_export_option_keys', 'my_export_option_keys' );

Contribute!

We'd love to hear your feedback as to how we could improve the Customizer Export/Import plugin, or better yet, see theme developers actively contribute! Don't hesitate to let us know if you're interested in contributing as we would gladly have others on board.

customizer-export-import's People

Contributors

fastlinemedia avatar huskynarr avatar mintbird avatar pross avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.