PageRenderTime 46ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/wp-content/themes/optimizer/customizer/controls/settings-postpage.php

https://gitlab.com/vanafroo/voipWEB
PHP | 284 lines | 206 code | 54 blank | 24 comment | 0 complexity | c905469b9de547045453150111d2f5ad MD5 | raw file
  1. <?php
  2. //----------------------SINGLE POST SECTION----------------------------------
  3. //Single Post Meta
  4. $wp_customize->add_setting('optimizer[post_info_id]', array(
  5. 'type' => 'option',
  6. 'default' => '1',
  7. 'sanitize_callback' => 'optimizer_sanitize_checkbox',
  8. 'transport' => 'postMessage',
  9. ) );
  10. $wp_customize->add_control( new Optimizer_Controls_Toggle_Control( $wp_customize, 'post_info_id', array(
  11. 'label' => __('Show Post Info','optimizer'),
  12. 'section' => 'singlepost_section',
  13. 'settings' => 'optimizer[post_info_id]',
  14. )) );
  15. //NEXT/PREVIOUS Posts
  16. $wp_customize->add_setting('optimizer[post_nextprev_id]', array(
  17. 'type' => 'option',
  18. 'default' => '1',
  19. 'sanitize_callback' => 'optimizer_sanitize_checkbox',
  20. 'transport' => 'postMessage',
  21. ) );
  22. $wp_customize->add_control( new Optimizer_Controls_Toggle_Control( $wp_customize, 'post_nextprev_id', array(
  23. 'label' => __('Next and Previous Posts','optimizer'),
  24. 'description' => __('Display Next and Previous Posts Under Single Post', 'optimizer' ),
  25. 'section' => 'singlepost_section',
  26. 'settings' => 'optimizer[post_nextprev_id]',
  27. )) );
  28. ///Show Comments
  29. $wp_customize->add_setting('optimizer[post_comments_id]', array(
  30. 'type' => 'option',
  31. 'default' => '1',
  32. 'sanitize_callback' => 'optimizer_sanitize_checkbox',
  33. 'transport' => 'postMessage',
  34. ) );
  35. $wp_customize->add_control( new Optimizer_Controls_Toggle_Control( $wp_customize, 'post_comments_id', array(
  36. 'label' => __('Comments','optimizer'),
  37. 'description' => __('Show/Hide Comments in Posts and Pages', 'optimizer' ),
  38. 'section' => 'singlepost_section',
  39. 'settings' => 'optimizer[post_comments_id]',
  40. )) );
  41. //----------------------PAGE HEADER SECTION----------------------------------
  42. //Page Header Default Background color
  43. $wp_customize->add_setting( 'optimizer[page_header_color]', array(
  44. 'type' => 'option',
  45. 'default' => '#EEEFF5',
  46. 'sanitize_callback' => 'sanitize_hex_color',
  47. 'transport' => 'postMessage',
  48. ) );
  49. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'page_header_color', array(
  50. 'label' => __('Page Header Background','optimizer'),
  51. 'section' => 'pageheader_section',
  52. 'settings' => 'optimizer[page_header_color]',
  53. ) ) );
  54. //Page Header Default Text color
  55. $wp_customize->add_setting( 'optimizer[page_header_txtcolor]', array(
  56. 'type' => 'option',
  57. 'default' => '#555555',
  58. 'sanitize_callback' => 'sanitize_hex_color',
  59. 'transport' => 'postMessage',
  60. ) );
  61. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'page_header_txtcolor', array(
  62. 'label' => __('Page Header Text color','optimizer'),
  63. 'section' => 'pageheader_section',
  64. 'settings' => 'optimizer[page_header_txtcolor]',
  65. ) ) );
  66. //----------------------BLOG PAGE SECTION----------------------------------
  67. /*GET LIST OF CATEGORIES*/
  68. $layercats = get_categories();
  69. $newList = array();
  70. foreach($layercats as $category) {
  71. $newList[$category->term_id] = $category->cat_name;
  72. }
  73. //BLOG CATEGORY SELECT
  74. //Page Header Default Text color
  75. $wp_customize->add_setting( 'optimizer[blog_cat_id]', array(
  76. 'type' => 'option',
  77. 'default' => '',
  78. 'sanitize_callback' => 'optimizer_sanitize_multicheck'
  79. ) );
  80. $wp_customize->add_control( new Optimizer_Multicheck_Control( $wp_customize, 'blog_cat_id', array(
  81. 'type' => 'multicheck',
  82. 'label' => __('Display Blog Posts from selected Categories *','optimizer'),
  83. 'section' => 'blogpage_section',
  84. 'choices' =>$newList,
  85. 'settings' => 'optimizer[blog_cat_id]'
  86. )) );
  87. //Blog Page Post Count
  88. $wp_customize->add_setting('optimizer[blog_num_id]', array(
  89. 'type' => 'option',
  90. 'default' => '9',
  91. 'sanitize_callback' => 'optimizer_sanitize_number',
  92. ) );
  93. $wp_customize->add_control('blog_num_id', array(
  94. 'type' => 'text',
  95. 'label' => __('Blog Page Posts Count *','optimizer'),
  96. 'section' => 'blogpage_section',
  97. 'settings' => 'optimizer[blog_num_id]',
  98. 'input_attrs' => array(
  99. 'class' => 'mini_control',
  100. )
  101. ) );
  102. //Blog LAYOUT SELECT
  103. $wp_customize->add_setting('optimizer[blog_layout_id]', array(
  104. 'type' => 'option',
  105. 'default' => '1',
  106. 'sanitize_callback' => 'optimizer_sanitize_number'
  107. ) );
  108. $wp_customize->add_control( new Optimizer_Control_Radio_Image( $wp_customize, 'blog_layout_id', array(
  109. 'type' => 'radio-image',
  110. 'label' => __('Blog Page Layout *','optimizer'),
  111. 'section' => 'blogpage_section',
  112. 'settings' => 'optimizer[blog_layout_id]',
  113. 'choices' => array(
  114. '1' => array( 'url' => get_template_directory_uri().'/assets/images/blog_layout1.png', 'label' => 'Blog Layout 1' ),
  115. ),
  116. ) ));
  117. ///Blog Page Thumbnails
  118. $wp_customize->add_setting('optimizer[show_blog_thumb]', array(
  119. 'type' => 'option',
  120. 'default' => '1',
  121. 'sanitize_callback' => 'optimizer_sanitize_checkbox',
  122. ) );
  123. $wp_customize->add_control( new Optimizer_Controls_Toggle_Control( $wp_customize, 'show_blog_thumb', array(
  124. 'label' => __('Blog Page Thumbnails *','optimizer'),
  125. 'section' => 'blogpage_section',
  126. 'settings' => 'optimizer[show_blog_thumb]',
  127. )) );
  128. //---------Post & Page Color SETTINGS---------------------
  129. //Post Title Color
  130. $wp_customize->add_setting( 'optimizer[title_txt_color_id]', array(
  131. 'type' => 'option',
  132. 'default' => '#666666',
  133. 'sanitize_callback' => 'sanitize_hex_color',
  134. 'transport' => 'postMessage',
  135. ) );
  136. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'title_txt_color_id', array(
  137. 'label' => __('Post Title Color','optimizer'),
  138. 'section' => 'postpage_color_section',
  139. 'settings' => 'optimizer[title_txt_color_id]',
  140. ) ) );
  141. //Link Color (Regular)
  142. $wp_customize->add_setting( 'optimizer[link_color_id]', array(
  143. 'type' => 'option',
  144. 'default' => '#3590ea',
  145. 'sanitize_callback' => 'sanitize_hex_color',
  146. 'transport' => 'postMessage',
  147. ) );
  148. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color_id', array(
  149. 'label' => __('Link Color (Regular)','optimizer'),
  150. 'section' => 'postpage_color_section',
  151. 'settings' => 'optimizer[link_color_id]',
  152. ) ) );
  153. //Link Color (HOVER)
  154. $wp_customize->add_setting( 'optimizer[link_color_hover]', array(
  155. 'type' => 'option',
  156. 'default' => '#1e73be',
  157. 'sanitize_callback' => 'sanitize_hex_color',
  158. 'transport' => 'postMessage',
  159. ) );
  160. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color_hover', array(
  161. 'label' => __('Links Color (Hover)','optimizer'),
  162. 'section' => 'postpage_color_section',
  163. 'settings' => 'optimizer[link_color_hover]',
  164. ) ) );
  165. //---------SIDEBAR & WIDGET Color SETTINGS---------------------
  166. //Sidebar Widgets Background Color
  167. $wp_customize->add_setting( 'optimizer[sidebar_color_id]', array(
  168. 'type' => 'option',
  169. 'default' => '#ffffff',
  170. 'sanitize_callback' => 'sanitize_hex_color',
  171. 'transport' => 'postMessage',
  172. ) );
  173. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebar_color_id', array(
  174. 'label' => __('Sidebar Widgets Background','optimizer'),
  175. 'section' => 'postpage_color_section',
  176. 'settings' => 'optimizer[sidebar_color_id]',
  177. ) ) );
  178. //Sidebar Widget Title Color
  179. $wp_customize->add_setting( 'optimizer[sidebar_tt_color_id]', array(
  180. 'type' => 'option',
  181. 'default' => '#666666',
  182. 'sanitize_callback' => 'sanitize_hex_color',
  183. 'transport' => 'postMessage',
  184. ) );
  185. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebar_tt_color_id', array(
  186. 'label' => __('Sidebar Widget Title Color','optimizer'),
  187. 'section' => 'postpage_color_section',
  188. 'settings' => 'optimizer[sidebar_tt_color_id]',
  189. ) ) );
  190. //Sidebar Widget Text Color
  191. $wp_customize->add_setting( 'optimizer[sidebartxt_color_id]', array(
  192. 'type' => 'option',
  193. 'default' => '#999999',
  194. 'sanitize_callback' => 'sanitize_hex_color',
  195. 'transport' => 'postMessage',
  196. ) );
  197. $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebartxt_color_id', array(
  198. 'label' => __('Sidebar Widget Text Color','optimizer'),
  199. 'section' => 'postpage_color_section',
  200. 'settings' => 'optimizer[sidebartxt_color_id]',
  201. ) ) );
  202. //Sidebar Widget Title Font Size
  203. $wp_customize->add_setting('optimizer[wgttitle_size_id]', array(
  204. 'type' => 'option',
  205. 'default' => '16px',
  206. 'sanitize_callback' => 'sanitize_text_field',
  207. 'transport' => 'postMessage',
  208. ) );
  209. $wp_customize->add_control('wgttitle_size_id', array(
  210. 'type' => 'text',
  211. 'label' => __('Sidebar Widget Title Font Size','optimizer'),
  212. 'section' => 'postpage_color_section',
  213. 'settings' => 'optimizer[wgttitle_size_id]',
  214. ) );
  215. //CATEGORY LAYOUT SELECT
  216. $wp_customize->add_setting('optimizer[cat_layout_id]', array(
  217. 'type' => 'option',
  218. 'default' => '1',
  219. 'sanitize_callback' => 'optimizer_sanitize_choices',
  220. ) );
  221. $wp_customize->add_control( new Optimizer_Control_Radio_Image( $wp_customize, 'cat_layout_id', array(
  222. 'type' => 'radio-image',
  223. 'label' => __('Category & Archive Page layout *','optimizer'),
  224. 'section' => 'category_section',
  225. 'settings' => 'optimizer[cat_layout_id]',
  226. 'choices' => array(
  227. '1' => array( 'url' => get_template_directory_uri().'/assets/images/layout1.png', 'label' => 'Layout 1' ),
  228. '4' => array( 'url' => get_template_directory_uri().'/assets/images/layout4.png', 'label' => 'Layout 4' ),
  229. ),
  230. ) ));