Skip to content

Instantly share code, notes, and snippets.

@shrimp2t
Created April 23, 2018 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrimp2t/3af0cba6b17d7d1877cb364b85d7b944 to your computer and use it in GitHub Desktop.
Save shrimp2t/3af0cba6b17d7d1877cb364b85d7b944 to your computer and use it in GitHub Desktop.
Customify Export Default Theme Mod
<?php
/**
* Plugin Name: Customify Export Default
* Plugin URI: #
* Description:
* Author:
* Version: 1.0
*/
function customify_customize_export(){
if ( isset( $_GET['customify_export']) ) {
//$mod = get_theme_mods();
$fields = Customify_Customizer::get_config();
$data = array();
foreach( $fields as $f ) {
$key = $f['name'];
$value = get_theme_mod( $key );
if ( ! empty( $value ) ) {
$data[ $key ] = $value;
}
}
var_export( $data );
die();
}
}
add_action( 'wp', 'customify_customize_export' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment