Guest User

Untitled

a guest
Jan 18th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.31 KB | None | 0 0
  1. <?php
  2. function appointment_footer_callout_customizer( $wp_customize ) {
  3.  
  4. //Home call out
  5.  
  6. $wp_customize->add_panel( 'appointment_footer_callout_setting', array(
  7. 'priority' => 820,
  8. 'capability' => 'edit_theme_options',
  9. 'title' => __('Footer callout settings', 'appointment'),
  10. ) );
  11.  
  12. //Contact Information Setting
  13. $wp_customize->add_section(
  14. 'footer_callout_settings',
  15. array(
  16. 'title' => __('Footer callout settings','appointment'),
  17. 'description' => '',
  18. 'panel' => 'appointment_footer_callout_setting',)
  19. );
  20.  
  21.  
  22. //Hide Index footer callout Section
  23.  
  24. $wp_customize->add_setting(
  25. 'appointment_options[front_callout_enable]',
  26. array(
  27. 'default' => '',
  28. 'capability' => 'edit_theme_options',
  29. 'type' => 'option',
  30. )
  31. );
  32. $wp_customize->add_control(
  33. 'appointment_options[front_callout_enable]',
  34. array(
  35. 'label' => __('Hide footer callout','appointment'),
  36. 'section' => 'footer_callout_settings',
  37. 'type' => 'checkbox',
  38. )
  39. );
  40.  
  41. //Form title
  42. $wp_customize->add_setting(
  43. 'appointment_options[front_contact_title]',
  44. array(
  45. 'default' => __('Stay in touch with us','appointment'),
  46. 'capability' => 'edit_theme_options',
  47. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  48. 'type' => 'option',
  49. )
  50. );
  51. $wp_customize->add_control( 'appointment_options[front_contact_title]',array(
  52. 'label' => __('Callout Header','appointment'),
  53. 'section' => 'footer_callout_settings',
  54. 'type' => 'text',) );
  55.  
  56. //Footer callout Call-us
  57. $wp_customize->add_setting(
  58. 'appointment_options[contact_one_icon]', array(
  59. 'default' => 'fa-phone',
  60. 'capability' => 'edit_theme_options',
  61. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  62. 'type' =>'option',
  63. ));
  64.  
  65. $wp_customize->add_control('appointment_options[contact_one_icon]', array(
  66. 'label' => __('Icon', 'appointment'),
  67. 'section' => 'footer_callout_settings',
  68. 'type' => 'text',
  69. ));
  70.  
  71. $wp_customize->add_setting(
  72. 'appointment_options[front_contact1_title]',
  73. array(
  74. 'default' => __('Have a question? Call us now','appointment'),
  75. 'capability' => 'edit_theme_options',
  76. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  77. 'type' => 'option',
  78. )
  79. );
  80. $wp_customize->add_control(
  81. 'appointment_options[front_contact1_title]',
  82. array(
  83. 'label' => __('Title','appointment'),
  84. 'section' => 'footer_callout_settings',
  85. 'type' => 'text',
  86. )
  87. );
  88.  
  89. $wp_customize->add_setting(
  90. 'appointment_options[front_contact1_val]',
  91. array(
  92. 'default' => '+82 334 843 52',
  93. 'capability' => 'edit_theme_options',
  94. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  95. 'type' => 'option',
  96. )
  97. );
  98. $wp_customize->add_control(
  99. 'appointment_options[front_contact1_val]',
  100. array(
  101. 'label' => __('Description','appointment'),
  102. 'section' => 'footer_callout_settings',
  103. 'type' => 'text',
  104. )
  105. );
  106.  
  107.  
  108. //callout Time
  109. $wp_customize->add_setting(
  110. 'appointment_options[contact_two_icon]', array(
  111. 'default' => 'fa-clock-o',
  112. 'capability' => 'edit_theme_options',
  113. 'type' => 'option',
  114. ));
  115.  
  116. $wp_customize->add_control( 'appointment_options[contact_two_icon]', array(
  117. 'label' => __('Icon', 'appointment'),
  118. 'section' => 'footer_callout_settings',
  119. 'type' => 'text',
  120. ));
  121.  
  122. $wp_customize->add_setting(
  123. 'appointment_options[front_contact2_title]',
  124. array(
  125. 'default' => __('We are open Mon - Fri','appointment'),
  126. 'capability' => 'edit_theme_options',
  127. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  128. 'type' => 'option',
  129. )
  130. );
  131. $wp_customize->add_control(
  132. 'appointment_options[front_contact2_title]',
  133. array(
  134. 'label' => __('Title','appointment'),
  135. 'section' => 'footer_callout_settings',
  136. 'type' => 'text',
  137. )
  138. );
  139.  
  140. $wp_customize->add_setting(
  141. 'appointment_options[front_contact2_val]',
  142. array(
  143. 'default' => __(': Mon - Fri : 08.00 - 18.00','appointment'),
  144. 'capability' => 'edit_theme_options',
  145. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  146. 'type' => 'option',
  147. )
  148. );
  149. $wp_customize->add_control(
  150. 'appointment_options[front_contact2_val]',
  151. array(
  152. 'label' => __('Description','appointment'),
  153. 'section' => 'footer_callout_settings',
  154. 'type' => 'text',
  155. )
  156. );
  157.  
  158. //Contact Email Setting
  159.  
  160. $wp_customize->add_setting(
  161. 'appointment_options[contact_three_icon]', array(
  162. 'default' => 'fa-envelope',
  163. 'capability' => 'edit_theme_options',
  164. 'type' => 'option',
  165. ));
  166.  
  167. $wp_customize->add_control( 'appointment_options[contact_three_icon]', array(
  168. 'label' => __('Icon', 'appointment'),
  169. 'section' => 'footer_callout_settings',
  170. 'type' => 'text',
  171. ));
  172.  
  173. $wp_customize->add_setting(
  174. 'appointment_options[front_contact3_title]',
  175. array(
  176. 'default' => __('Drop us a mail','appointment'),
  177. 'capability' => 'edit_theme_options',
  178. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  179. 'type' => 'option',
  180. )
  181. );
  182. $wp_customize->add_control(
  183. 'appointment_options[front_contact3_title]',
  184. array(
  185. 'label' => __('Title','appointment'),
  186. 'section' => 'footer_callout_settings',
  187. 'type' => 'text',
  188. )
  189. );
  190.  
  191. $wp_customize->add_setting(
  192. 'appointment_options[front_contact3_val]',
  193. array(
  194. 'default' => 'info@yoursupport.com',
  195. 'capability' => 'edit_theme_options',
  196. 'sanitize_callback' => 'appointment_footer_callout_sanitize_html',
  197. 'type' => 'option',
  198. )
  199. );
  200. $wp_customize->add_control(
  201. 'appointment_options[front_contact3_val]',
  202. array(
  203. 'label' => __('Description','appointment'),
  204. 'section' => 'footer_callout_settings',
  205. 'type' => 'text',
  206. )
  207. );
  208. function appointment_footer_callout_sanitize_html( $input ) {
  209.  
  210. return force_balance_tags( $input );
  211.  
  212. }
  213.  
  214.  
  215. }
  216. add_action( 'customize_register', 'appointment_footer_callout_customizer' );
  217. ?>
Add Comment
Please, Sign In to add comment