Няма описание

customizer.php 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. *XShop Lite Theme Customizer
  4. *
  5. * @package XShop Lite
  6. */
  7. /**
  8. * Add postMessage support for site title and description for the Theme Customizer.
  9. *
  10. * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  11. */
  12. function xshop_lite_customize_register( $wp_customize ) {
  13. $wp_customize->remove_control('xshop_header_address1');
  14. $wp_customize->remove_control('xshop_header_address2');
  15. $wp_customize->remove_control('xshop_blog_layout');
  16. $wp_customize->remove_control('xshop_blog_style');
  17. $wp_customize->add_setting('xshop_lite_blog_layout', array(
  18. 'default' => 'leftside',
  19. 'capability' => 'edit_theme_options',
  20. 'type' => 'theme_mod',
  21. 'sanitize_callback' => 'xshop_sanitize_select',
  22. 'transport' => 'refresh',
  23. ));
  24. $wp_customize->add_control('xshop_lite_blog_layout', array(
  25. 'label' => __('Select Blog Layout', 'xshop-lite'),
  26. 'description'=> __('Right and Left sidebar only show when sidebar widget is available. ', 'xshop-lite'),
  27. 'section' => 'xshop_blog',
  28. 'settings' => 'xshop_lite_blog_layout',
  29. 'type' => 'select',
  30. 'choices' => array(
  31. 'rightside' => __('Right Sidebar', 'xshop-lite'),
  32. 'leftside' => __('Left Sidebar', 'xshop-lite'),
  33. 'fullwidth' => __('No Sidebar', 'xshop-lite'),
  34. ),
  35. ));
  36. $wp_customize->add_setting('xshop_lite_blog_style', array(
  37. 'default' => 'list',
  38. 'capability' => 'edit_theme_options',
  39. 'type' => 'theme_mod',
  40. 'sanitize_callback' => 'xshop_sanitize_select',
  41. 'transport' => 'refresh',
  42. ));
  43. $wp_customize->add_control('xshop_lite_blog_style', array(
  44. 'label' => __('Select Blog Style', 'xshop-lite'),
  45. 'section' => 'xshop_blog',
  46. 'settings' => 'xshop_lite_blog_style',
  47. 'type' => 'select',
  48. 'choices' => array(
  49. 'list' => __('List Style', 'xshop-lite'),
  50. 'grid' => __('Grid Style', 'xshop-lite'),
  51. 'classic' => __('Classic Style', 'xshop-lite'),
  52. ),
  53. ));
  54. }
  55. add_action( 'customize_register', 'xshop_lite_customize_register',99 );