Nessuna descrizione

shop-customizer.php 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * XShop woocommerce Customizer
  4. *
  5. * @package XShop
  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_shop_customize_register( $wp_customize ) {
  13. //xshop blog settings
  14. $wp_customize->add_section('xshop_woo', array(
  15. 'title' => __('XShop Shop Settings', 'xshop'),
  16. 'capability' => 'edit_theme_options',
  17. 'description' => __('XShop theme shop settings', 'xshop'),
  18. 'panel' => 'xshop_settings',
  19. ));
  20. $wp_customize->add_setting('xshop_woo_container', array(
  21. 'default' => 'container',
  22. 'capability' => 'edit_theme_options',
  23. 'type' => 'theme_mod',
  24. 'sanitize_callback' => 'xshop_sanitize_select',
  25. 'transport' => 'refresh',
  26. ));
  27. $wp_customize->add_control('xshop_woo_container', array(
  28. 'label' => __('Shop Container Type', 'xshop'),
  29. 'description'=> __('You can set standard container or full width container for shop page. ', 'xshop'),
  30. 'section' => 'xshop_woo',
  31. 'settings' => 'xshop_woo_container',
  32. 'type' => 'select',
  33. 'choices' => array(
  34. 'container' => __('Standard Container', 'xshop'),
  35. 'container-fluid' => __('Full width Container', 'xshop'),
  36. ),
  37. ));
  38. $wp_customize->add_setting('xshop_woo_layout', array(
  39. 'default' => 'rightside',
  40. 'capability' => 'edit_theme_options',
  41. 'type' => 'theme_mod',
  42. 'sanitize_callback' => 'xshop_sanitize_select',
  43. 'transport' => 'refresh',
  44. ));
  45. $wp_customize->add_control('xshop_woo_layout', array(
  46. 'label' => __('Select Shop Layout', 'xshop'),
  47. 'description'=> __('Right and Left sidebar only show when sidebar widget is available. ', 'xshop'),
  48. 'section' => 'xshop_woo',
  49. 'settings' => 'xshop_woo_layout',
  50. 'type' => 'select',
  51. 'choices' => array(
  52. 'rightside' => __('Right Sidebar', 'xshop'),
  53. 'leftside' => __('Left Sidebar', 'xshop'),
  54. 'fullwidth' => __('No Sidebar', 'xshop'),
  55. ),
  56. ));
  57. }
  58. add_action( 'customize_register', 'xshop_shop_customize_register' );