skt_pathway_customize_register

SKT Pathway Theme Customizer.

Description

skt_pathway_customize_register( $wp_customize ); 

Parameters (1)

0. $wp_customize
The wp customize.

Usage

  1. if ( !function_exists( 'skt_pathway_customize_register' ) ) { 
  2. require_once '/inc/customizer.php'; 
  3.  
  4. // The wp customize. 
  5. $wp_customize = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = skt_pathway_customize_register($wp_customize); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/customizer.php  
  1. function skt_pathway_customize_register( $wp_customize ) { 
  2.  
  3. //Add a class for titles 
  4. class skt_pathway_Info extends WP_Customize_Control { 
  5. public $type = 'info'; 
  6. public $label = ''; 
  7. public function render_content() { 
  8. ?> 
  9. <h3 style="text-decoration: underline; color: #DA4141; text-transform: uppercase;"><?php echo esc_html( $this->label ); ?></h3> 
  10. <?php 
  11.  
  12. function skt_pathway_sanitize_checkbox( $checked ) { 
  13. // Boolean check. 
  14. return ( ( isset( $checked ) && true == $checked ) ? true : false ); 
  15.  
  16. $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 
  17. $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 
  18.  
  19. $wp_customize->add_setting('color_scheme', array( 
  20. 'default' => '#a0ce4e',  
  21. 'sanitize_callback' => 'sanitize_hex_color' 
  22. )); 
  23.  
  24. $wp_customize->add_control( 
  25. new WP_Customize_Color_Control($wp_customize, 'color_scheme', array( 
  26. 'label' => __('Color Scheme', 'skt-pathway'),  
  27. 'description' => __( '', 'skt-pathway'),  
  28. 'section' => 'colors',  
  29. 'settings' => 'color_scheme' 
  30. )) 
  31. ); 
  32.  
  33. // Slider Section  
  34. $wp_customize->add_section( 
  35. 'slider_section',  
  36. array( 
  37. 'title' => __('Slider Settings', 'skt-pathway'),  
  38. 'priority' => null,  
  39. 'description' => __( 'Featured Image Size Should be ( 1000x434 ) [ This only work when static front page is selected. ]', 'skt-pathway' ),  
  40. ); 
  41.  
  42. $wp_customize->add_setting('page-setting1', array( 
  43. 'default' => '0',  
  44. 'capability' => 'edit_theme_options',  
  45. 'sanitize_callback' => 'skt_pathway_sanitize_integer
  46. )); 
  47.  
  48. $wp_customize->add_control('page-setting1', array( 
  49. 'type' => 'dropdown-pages',  
  50. 'label' => __('Select page for slide one:', 'skt-pathway'),  
  51. 'section' => 'slider_section' 
  52. ));  
  53.  
  54. $wp_customize->add_setting('page-setting2', array( 
  55. 'default' => '0',  
  56. 'capability' => 'edit_theme_options',  
  57. 'sanitize_callback' => 'skt_pathway_sanitize_integer
  58. )); 
  59.  
  60. $wp_customize->add_control('page-setting2', array( 
  61. 'type' => 'dropdown-pages',  
  62. 'label' => __('Select page for slide two:', 'skt-pathway'),  
  63. 'section' => 'slider_section' 
  64. ));  
  65.  
  66. $wp_customize->add_setting('page-setting3', array( 
  67. 'default' => '0',  
  68. 'capability' => 'edit_theme_options',  
  69. 'sanitize_callback' => 'skt_pathway_sanitize_integer
  70. )); 
  71.  
  72. $wp_customize->add_control('page-setting3', array( 
  73. 'type' => 'dropdown-pages',  
  74. 'label' => __('Select page for slide three:', 'skt-pathway'),  
  75. 'section' => 'slider_section' 
  76. )); 
  77.  
  78. $wp_customize->add_setting('hide_slides', array( 
  79. 'default' => true,  
  80. 'sanitize_callback' => 'skt_pathway_sanitize_checkbox',  
  81. 'capability' => 'edit_theme_options',  
  82. ));  
  83.  
  84. $wp_customize->add_control( 'hide_slides', array( 
  85. 'settings' => 'hide_slides',  
  86. 'section' => 'slider_section',  
  87. 'label' => __('Uncheck This Option To Display Slider', 'skt-pathway'),  
  88. 'type' => 'checkbox' 
  89. ));  
  90.  
  91. // Home Section One  
  92. $wp_customize->add_section('homepage_section_one', array( 
  93. 'title' => __('Home Section One', 'skt-pathway'),  
  94. 'description' => __('Select Pages from the dropdown for home section one [ This only work when static front page is selected. ]', 'skt-pathway'),  
  95. 'priority' => null 
  96. ));  
  97.  
  98. $wp_customize->add_setting('page-section1', array( 
  99. 'default' => '0',  
  100. 'capability' => 'edit_theme_options',  
  101. 'sanitize_callback' => 'skt_pathway_sanitize_integer',  
  102. )); 
  103.  
  104. $wp_customize->add_control( 'page-section1', array('type' => 'dropdown-pages',  
  105. 'label' => __('', 'skt-pathway'),  
  106. 'section' => 'homepage_section_one',  
  107. ));  
  108.  
  109. $wp_customize->add_setting('hide_section1', array( 
  110. 'default' => true,  
  111. 'sanitize_callback' => 'skt_pathway_sanitize_checkbox',  
  112. 'capability' => 'edit_theme_options',  
  113. ));  
  114.  
  115. $wp_customize->add_control( 'hide_section1', array( 
  116. 'settings' => 'hide_section1',  
  117. 'section' => 'homepage_section_one',  
  118. 'label' => __('Uncheck This Option To Display This Section', 'skt-pathway'),  
  119. 'type' => 'checkbox' 
  120. )); 
  121.  
  122. // 
  123.  
  124. // Home Section Two  
  125. $wp_customize->add_section('homepage_section_two', array( 
  126. 'title' => __('Home Section Two', 'skt-pathway'),  
  127. 'description' => __('Select Pages from the dropdown for home section two [ This only work when static front page is selected. ]', 'skt-pathway'),  
  128. 'priority' => null 
  129. ));  
  130.  
  131. $wp_customize->add_setting('page-section2', array( 
  132. 'default' => '0',  
  133. 'capability' => 'edit_theme_options',  
  134. 'sanitize_callback' => 'skt_pathway_sanitize_integer',  
  135. )); 
  136.  
  137. $wp_customize->add_control( 'page-section2', array('type' => 'dropdown-pages',  
  138. 'label' => __('', 'skt-pathway'),  
  139. 'section' => 'homepage_section_two',  
  140. ));  
  141.  
  142. $wp_customize->add_setting('hide_section2', array( 
  143. 'default' => true,  
  144. 'sanitize_callback' => 'skt_pathway_sanitize_checkbox',  
  145. 'capability' => 'edit_theme_options',  
  146. ));  
  147.  
  148. $wp_customize->add_control( 'hide_section2', array( 
  149. 'settings' => 'hide_section2',  
  150. 'section' => 'homepage_section_two',  
  151. 'label' => __('Uncheck This Option To Display This Section', 'skt-pathway'),  
  152. 'type' => 'checkbox' 
  153. ));  
  154.  
  155. // Homepage Section Three  
  156. $wp_customize->add_section('homepage_boxes_section', array( 
  157. 'title' => __('Home Section Three', 'skt-pathway'),  
  158. 'description' => __('Select Pages from the dropdown for homepage four boxes section [ This only work when static front page is selected. ]', 'skt-pathway'),  
  159. 'priority' => null 
  160. ));  
  161.  
  162. $wp_customize->add_setting('page-column1', array( 
  163. 'default' => '0',  
  164. 'capability' => 'edit_theme_options',  
  165. 'sanitize_callback' => 'skt_pathway_sanitize_integer',  
  166. )); 
  167.  
  168. $wp_customize->add_control( 'page-column1', array('type' => 'dropdown-pages',  
  169. 'label' => __('', 'skt-pathway'),  
  170. 'section' => 'homepage_boxes_section',  
  171. ));  
  172.  
  173.  
  174. $wp_customize->add_setting('page-column2', array( 
  175. 'default' => '0',  
  176. 'capability' => 'edit_theme_options',  
  177. 'sanitize_callback' => 'skt_pathway_sanitize_integer',  
  178. )); 
  179.  
  180. $wp_customize->add_control( 'page-column2', array('type' => 'dropdown-pages',  
  181. 'label' => __('', 'skt-pathway'),  
  182. 'section' => 'homepage_boxes_section',  
  183. )); 
  184.  
  185. $wp_customize->add_setting('page-column3', array( 
  186. 'default' => '0',  
  187. 'capability' => 'edit_theme_options',  
  188. 'sanitize_callback' => 'skt_pathway_sanitize_integer',  
  189. )); 
  190.  
  191. $wp_customize->add_control( 'page-column3', array('type' => 'dropdown-pages',  
  192. 'label' => __('', 'skt-pathway'),  
  193. 'section' => 'homepage_boxes_section',  
  194. ));  
  195.  
  196. $wp_customize->add_setting('hide_boxes', array( 
  197. 'default' => true,  
  198. 'sanitize_callback' => 'skt_pathway_sanitize_checkbox',  
  199. 'capability' => 'edit_theme_options',  
  200. ));  
  201.  
  202. $wp_customize->add_control( 'hide_boxes', array( 
  203. 'settings' => 'hide_boxes',  
  204. 'section' => 'homepage_boxes_section',  
  205. 'label' => __('Uncheck This Option To Display This Section', 'skt-pathway'),  
  206. 'type' => 'checkbox' 
  207. ));  
  208. //end homepage boxes ection