Пример #1
0
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_default_theme_options = bavotasan_default_theme_options();
     $wp_customize->get_setting('background_color')->transport = 'refresh';
     $wp_customize->get_setting('background_image')->transport = 'refresh';
     $wp_customize->get_setting('background_repeat')->transport = 'refresh';
     $wp_customize->get_setting('background_position_x')->transport = 'refresh';
     $wp_customize->get_setting('background_attachment')->transport = 'refresh';
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'tienda'), 'priority' => 35));
     $wp_customize->add_setting('width', array('default' => $bavotasan_default_theme_options['width'], 'sanitize_callback' => 'absint'));
     $wp_customize->add_control('width', array('label' => __('Site Width', 'tienda'), 'section' => 'bavotasan_layout', 'priority' => 10, 'type' => 'select', 'choices' => array('1170' => __('1200px', 'tienda'), '992' => __('992px', 'tienda'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%');
     $wp_customize->add_setting('primary', array('default' => $bavotasan_default_theme_options['primary'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('primary', array('label' => __('Main Content Width', 'tienda'), 'section' => 'bavotasan_layout', 'priority' => 15, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('layout', array('default' => $bavotasan_default_theme_options['layout'], 'sanitize_callback' => 'esc_attr'));
     $layout_choices = array('left' => __('Left', 'tienda'), 'right' => __('Right', 'tienda'));
     $wp_customize->add_control(new Bavotasan_Post_Layout_Control($wp_customize, 'layout', array('label' => __('Sidebar Layout', 'tienda'), 'section' => 'bavotasan_layout', 'priority' => 25, 'choices' => $layout_choices)));
 }