preview.php 947 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. function vamtam_customizer_setup_partial_options() {
  3. global $vamtam_theme;
  4. $raw_options = json_decode( stripslashes_deep( $_POST['customized'] ), true );
  5. $old_opts = $vamtam_theme;
  6. if ( isset( $_POST['customized'] ) && ! empty( $raw_options ) ) {
  7. if ( is_array( $raw_options ) ) {
  8. foreach ( $raw_options as $key => $value ) {
  9. if ( strpos( $key, 'vamtam_theme' ) !== false ) {
  10. $key = str_replace( 'vamtam_theme[', '', rtrim( $key, ']' ) );
  11. $vamtam_theme[ $key ] = $value;
  12. }
  13. }
  14. }
  15. }
  16. }
  17. add_action( 'customize_render_partials_before', 'vamtam_customizer_setup_partial_options' );
  18. function vamtam_customize_register( WP_Customize_Manager $wp_customize ) {
  19. include VAMTAM_DIR . 'customizer/preview/general.php';
  20. include VAMTAM_DIR . 'customizer/preview/layout.php';
  21. include VAMTAM_DIR . 'customizer/preview/styles.php';
  22. }
  23. add_action( 'customize_register', 'vamtam_customize_register', 20 );