webriti

Appointment call out in contact

Feb 16th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.12 KB | None | 0 0
  1. <?php
  2. function appointment_template_customizer( $wp_customize ) {
  3. //Template panel
  4. $wp_customize->add_panel( 'appointment_template', array(
  5. 'priority' => 920,
  6. 'capability' => 'edit_theme_options',
  7. 'title' => __('Template Settings', 'appointment'),
  8. ) );
  9.  
  10. // add section to manage About
  11. $wp_customize->add_section(
  12. 'about_section_settings',
  13. array(
  14. 'title' => __('About Us Template','appointment'),
  15. 'description' => __('','appointment'),
  16. 'panel' => 'appointment_template',
  17. 'priority' => 100,
  18.  
  19. )
  20. );
  21.  
  22. // enable/disable Team Section
  23. $wp_customize->add_setting(
  24. 'appointment_options[team_section_enable]',
  25. array('capability' => 'edit_theme_options',
  26. 'type' => 'option',
  27. ));
  28.  
  29. $wp_customize->add_control(
  30. 'appointment_options[team_section_enable]',
  31. array(
  32. 'type' => 'checkbox',
  33. 'label' => __('Hide Team Section','appointment'),
  34. 'section' => 'about_section_settings',
  35. )
  36. );
  37.  
  38. //Team Title
  39. $wp_customize->add_setting(
  40. 'appointment_options[about_team_title]',
  41. array(
  42. 'default' => __('Meet Our Great Team','appointment'),
  43. 'capability' => 'edit_theme_options',
  44. 'sanitize_callback' => 'appointment_sanitize_html',
  45. 'type' => 'option',
  46. )
  47. );
  48. $wp_customize->add_control( 'appointment_options[about_team_title]',array(
  49. 'label' => __('Team Section Title','appointment'),
  50. 'section' => 'about_section_settings',
  51. 'type' => 'text',) );
  52.  
  53. //Team Description
  54. $wp_customize->add_setting(
  55. 'appointment_options[about_team_description]',
  56. array(
  57. 'default' => __('We create our themes with a thuought of our customers, therefore our team works hard to provide you best technical support in the world','appointment'),
  58. 'capability' => 'edit_theme_options',
  59. 'sanitize_callback' => 'sanitize_text_field',
  60. 'type' => 'option' ,
  61. )
  62. );
  63. $wp_customize->add_control( 'appointment_options[about_team_description]',array(
  64. 'label' => __('Team Section Description','appointment'),
  65. 'section' => 'about_section_settings',
  66. 'type' => 'text',) );
  67.  
  68. // Add Team link
  69.  
  70. class WP_team_Customize_Control extends WP_Customize_Control {
  71. public $type = 'new_menu';
  72. /**
  73. * Render the control's content.
  74. */
  75. public function render_content() {
  76. ?>
  77. <a href="<?php bloginfo ( 'url' );?>/wp-admin/edit.php?post_type=appointment_team" class="button" target="_blank"><?php _e( 'Click Here to add Team Member', 'appointment' ); ?></a>
  78. <?php
  79. }
  80. }
  81.  
  82.  
  83. $wp_customize->add_setting(
  84. 'team',
  85. array(
  86. 'default' => __('','appointment'),
  87. 'capability' => 'edit_theme_options',
  88. 'sanitize_callback' => 'sanitize_text_field',
  89. 'type' => 'option',
  90. )
  91. );
  92. $wp_customize->add_control( new WP_team_Customize_Control( $wp_customize, 'team', array(
  93. 'label' => __('Discover Appointment Pro','appointment'),
  94. 'section' => 'about_section_settings',
  95. ))
  96. );
  97.  
  98.  
  99.  
  100. // enable/disable client section
  101. $wp_customize->add_setting(
  102. 'appointment_options[client_section_enable]',
  103. array('capability' => 'edit_theme_options',
  104. 'type' => 'option',
  105. ));
  106.  
  107. $wp_customize->add_control(
  108. 'appointment_options[client_section_enable]',
  109. array(
  110. 'type' => 'checkbox',
  111. 'label' => __('Hide Client Section','appointment'),
  112. 'section' => 'about_section_settings',
  113. )
  114. );
  115.  
  116.  
  117. // enable/disable Footer contact section
  118. $wp_customize->add_setting(
  119. 'appointment_options[footer_callout_section_enable]',
  120. array('capability' => 'edit_theme_options',
  121. 'type' => 'option',
  122. ));
  123.  
  124. $wp_customize->add_control(
  125. 'appointment_options[footer_callout_section_enable]',
  126. array(
  127. 'type' => 'checkbox',
  128. 'label' => __('Hide Footer contact callout Section','appointment'),
  129. 'section' => 'about_section_settings',
  130. )
  131. );
  132.  
  133.  
  134. //enable/disable blog post meta content
  135. $wp_customize->add_section( 'blog_template' , array(
  136. 'title' => __('Blog Settings', 'appointment'),
  137. 'panel' => 'appointment_template',
  138. 'priority' => 150,
  139. ) );
  140.  
  141. $wp_customize->add_setting(
  142. 'appointment_options[blog_meta_section_settings]',
  143. array(
  144. 'default' => 0,
  145. 'capability' => 'edit_theme_options',
  146. 'type' => 'option',
  147.  
  148. )
  149. );
  150. $wp_customize->add_control(
  151. 'appointment_options[blog_meta_section_settings]',
  152. array(
  153. 'label' => __('Hide Post Meta From Blog Pages, Archive Pages, Categories, Author etc.','appointment'),
  154. 'section' => 'blog_template',
  155. 'type' => 'checkbox',
  156. )
  157. );
  158.  
  159. // add section to manage Setting
  160. $wp_customize->add_section(
  161. 'setting_section_settings',
  162. array(
  163. 'title' => __('Service Setting Template','appointment'),
  164. 'description' => __('','appointment'),
  165. 'panel' => 'appointment_template',
  166. 'priority' => 100,
  167.  
  168. )
  169. );
  170.  
  171. // Hide testimonial on settings page
  172. $wp_customize->add_setting(
  173. 'appointment_options[hide_testimonial_setting]',
  174. array(
  175. 'default' => '',
  176. 'capability' => 'edit_theme_options',
  177. 'type' => 'option',
  178. ));
  179.  
  180. $wp_customize->add_control(
  181. 'appointment_options[hide_testimonial_setting]',
  182. array(
  183. 'label' => __('Hide Testimonial','appointment'),
  184. 'section' => 'setting_section_settings',
  185. 'type' => 'checkbox',
  186. )
  187. );
  188.  
  189. //Hide client section on setting page
  190.  
  191. $wp_customize->add_setting(
  192. 'appointment_options[hide_client_setting]',
  193. array(
  194. 'default' => '',
  195. 'capability' => 'edit_theme_options',
  196. 'type' => 'option',
  197. )
  198. );
  199. $wp_customize->add_control(
  200. 'appointment_options[hide_client_setting]',
  201. array(
  202. 'label' => __('Hide Client','appointment'),
  203. 'section' => 'setting_section_settings',
  204. 'type' => 'checkbox',
  205. )
  206. );
  207.  
  208. //Hide contact footer calout on setting page
  209.  
  210. $wp_customize->add_setting(
  211. 'appointment_options[hide_footer_callout_setting]',
  212. array(
  213. 'default' => '',
  214. 'capability' => 'edit_theme_options',
  215. 'type' => 'option',)
  216. );
  217. $wp_customize->add_control(
  218. 'appointment_options[hide_footer_callout_setting]',
  219. array(
  220. 'label' => __('Hide Footer callout','appointment'),
  221. 'section' => 'setting_section_settings',
  222. 'type' => 'checkbox',
  223. )
  224. );
  225.  
  226. // add section to manage contact page
  227. $wp_customize->add_section(
  228. 'contact_section_settings',
  229. array(
  230. 'title' => __('Contact page Setting','appointment'),
  231. 'description' => __('','appointment'),
  232. 'panel' => 'appointment_template',)
  233. );
  234.  
  235. //Form title
  236. $wp_customize->add_setting(
  237. 'appointment_options[send_usmessage]',
  238. array(
  239. 'default' => __('Send Us a Message','appointment'),
  240. 'capability' => 'edit_theme_options',
  241. 'sanitize_callback' => 'appointment_sanitize_html',
  242. 'type' => 'option',
  243. )
  244. );
  245. $wp_customize->add_control( 'appointment_options[send_usmessage]',array(
  246. 'label' => __('Contact Form Title','appointment'),
  247. 'section' => 'contact_section_settings',
  248. 'type' => 'text',) );
  249.  
  250. // enable/disable google map
  251. $wp_customize->add_setting(
  252. 'appointment_options[contact_google_map_enabled]',
  253. array('capability' => 'edit_theme_options',
  254. 'type' => 'option',
  255. ));
  256.  
  257. $wp_customize->add_control(
  258. 'appointment_options[contact_google_map_enabled]',
  259. array(
  260. 'type' => 'checkbox',
  261. 'label' => __('Hide Google Map','appointment'),
  262. 'section' => 'contact_section_settings',
  263. )
  264. );
  265.  
  266.  
  267. //Google map
  268. $wp_customize->add_setting(
  269. 'appointment_options[contact_google_title]',
  270. array(
  271. 'default' => __('Find the Address','appointment'),
  272. 'capability' => 'edit_theme_options',
  273. 'sanitize_callback' => 'appointment_sanitize_html',
  274. 'type' => 'option'
  275. )
  276. );
  277. $wp_customize->add_control( 'appointment_options[contact_google_title]',array(
  278. 'label' => __('Contact Google map Title','appointment'),
  279. 'section' => 'contact_section_settings',
  280. 'type' => 'text',) );
  281.  
  282.  
  283. //Google Map URL
  284. $wp_customize->add_setting(
  285. 'appointment_options[contact_google_map_url]',
  286. array(
  287. 'default' => 'https://maps.google.co.in/maps?f=q&source=s_q&hl=en&geocode=&q=Kota+Industrial+Area,+Kota,+Rajasthan&aq=2&oq=kota+&sll=25.003049,76.117499&sspn=0.020225,0.042014&t=h&ie=UTF8&hq=&hnear=Kota+Industrial+Area,+Kota,+Rajasthan&z=13&ll=25.142832,75.879538',
  288. 'capability' => 'edit_theme_options',
  289. 'type' => 'option',
  290. )
  291. );
  292. $wp_customize->add_control( 'appointment_options[contact_google_map_url]',array(
  293. 'label' => __('Google Map URL:','appointment'),
  294. 'section' => 'contact_section_settings',
  295. 'type' => 'textarea',) );
  296.  
  297.  
  298. // Add Team link
  299.  
  300. class WP_map_Customize_Control extends WP_Customize_Control {
  301. public $type = 'new_menu';
  302. /**
  303. * Render the control's content.
  304. */
  305. public function render_content() {
  306. ?>
  307. <a href="http://maps.google.com/" class="button" target="_blank"><?php _e( 'Click Here to add Google MAP', 'appointment' ); ?></a>
  308. <?php
  309. }
  310. }
  311.  
  312. $wp_customize->add_setting(
  313. 'map',
  314. array(
  315. 'default' => __('','appointment'),
  316. 'capability' => 'edit_theme_options',
  317. 'sanitize_callback' => 'sanitize_text_field',
  318. 'type' => 'option'
  319. )
  320. );
  321. $wp_customize->add_control( new WP_map_Customize_Control( $wp_customize, 'map', array(
  322. 'section' => 'contact_section_settings',
  323. ))
  324. );
  325.  
  326. //Contact Information Setting
  327. $wp_customize->add_section(
  328. 'contact_info_settings',
  329. array(
  330. 'title' => __('Contact Information Settings','appointment'),
  331. 'description' => '',
  332. 'panel' => 'appointment_template',)
  333. );
  334.  
  335. // enable/disable Contact info setting
  336. $wp_customize->add_setting(
  337. 'appointment_options[contact-callout-enable]',
  338. array('capability' => 'edit_theme_options',
  339. 'type' => 'option',
  340. ));
  341.  
  342. $wp_customize->add_control(
  343. 'appointment_options[contact-callout-enable]',
  344. array(
  345. 'type' => 'checkbox',
  346. 'label' => __('Hide Contact info Section','appointment'),
  347. 'section' => 'contact_info_settings',
  348. )
  349. );
  350. //Form title
  351. $wp_customize->add_setting(
  352. 'appointment_options[contact_title]',
  353. array(
  354. 'default' => __('Contact Info','appointment'),
  355. 'capability' => 'edit_theme_options',
  356. 'sanitize_callback' => 'appointment_sanitize_html',
  357. 'type' => 'option',
  358. )
  359. );
  360. $wp_customize->add_control( 'appointment_options[contact_title]',array(
  361. 'label' => __('Contact Information Title','appointment'),
  362. 'section' => 'contact_info_settings',
  363. 'type' => 'text',) );
  364.  
  365. //Form Decription
  366.  
  367. $wp_customize->add_setting(
  368. 'appointment_options[contact_description]',
  369. array(
  370. 'default' => __('Read what customers are saying','appointment'),
  371. 'capability' => 'edit_theme_options',
  372. 'sanitize_callback' => 'sanitize_text_field',
  373. 'type' => 'option'
  374. )
  375. );
  376. $wp_customize->add_control( 'appointment_options[contact_description]',array(
  377. 'label' => __('Contact Information Description','appointment'),
  378. 'section' => 'contact_info_settings',
  379. 'type' => 'text',) );
  380.  
  381. //Contact Call-us
  382. $wp_customize->add_setting(
  383. 'appointment_options[contact_call_icon]', array(
  384. 'default' => 'fa-phone',
  385. 'capability' => 'edit_theme_options',
  386. 'type' => 'option',
  387. ));
  388.  
  389. $wp_customize->add_control( 'appointment_options[contact_call_icon]', array(
  390. 'label' => __('Contact Call Icon', 'appointment'),
  391. 'section' => 'contact_info_settings',
  392. 'type' => 'text',
  393. ));
  394.  
  395. $wp_customize->add_setting(
  396. 'appointment_options[contact_call_title]',
  397. array(
  398. 'default' => __('Have a question? Call us now','appointment'),
  399. 'capability' => 'edit_theme_options',
  400. 'sanitize_callback' => 'appointment_sanitize_html',
  401. 'type' => 'option',
  402. )
  403. );
  404. $wp_customize->add_control(
  405. 'appointment_options[contact_call_title]',
  406. array(
  407. 'label' => __('Contact call Title','appointment'),
  408. 'section' => 'contact_info_settings',
  409. 'type' => 'text',
  410. )
  411. );
  412.  
  413. $wp_customize->add_setting(
  414. 'appointment_options[contact_call_description]',
  415. array(
  416. 'default' => __('+82 334 843 52','appointment'),
  417. 'capability' => 'edit_theme_options',
  418. 'sanitize_callback' => 'sanitize_text_field',
  419. 'type' => 'option'
  420. )
  421. );
  422. $wp_customize->add_control(
  423. 'appointment_options[contact_call_description]',
  424. array(
  425. 'label' => __('Contact call Description','appointment'),
  426. 'section' => 'contact_info_settings',
  427. 'type' => 'text',
  428. )
  429. );
  430.  
  431.  
  432. //Contact Address
  433. $wp_customize->add_setting(
  434. 'appointment_options[contact_add_icon]', array(
  435. 'default' => 'fa-map-marker',
  436. 'capability' => 'edit_theme_options',
  437. 'type' => 'option',
  438. ));
  439.  
  440. $wp_customize->add_control( 'appointment_options[contact_add_icon]', array(
  441. 'label' => __('Contact address icon', 'appointment'),
  442. 'section' => 'contact_info_settings',
  443. 'type' => 'text',
  444. ));
  445.  
  446. $wp_customize->add_setting(
  447. 'appointment_options[contact_add_title]',
  448. array(
  449. 'default' => __('Our Office Location','appointment'),
  450. 'capability' => 'edit_theme_options',
  451. 'sanitize_callback' => 'appointment_sanitize_html',
  452. 'type' => 'option',
  453. )
  454. );
  455. $wp_customize->add_control(
  456. 'appointment_options[contact_add_title]',
  457. array(
  458. 'label' => __('Contact address Title','appointment'),
  459. 'section' => 'contact_info_settings',
  460. 'type' => 'text',
  461. )
  462. );
  463.  
  464. $wp_customize->add_setting(
  465. 'appointment_options[contact_add_description]',
  466. array(
  467. 'default' => __('3108 Evergreen Lane Washington, (USA) 90032','appointment'),
  468. 'capability' => 'edit_theme_options',
  469. 'sanitize_callback' => 'sanitize_text_field',
  470. 'type' => 'option',
  471. )
  472. );
  473. $wp_customize->add_control(
  474. 'appointment_options[contact_add_description]',
  475. array(
  476. 'label' => __('Contact Address Description','appointment'),
  477. 'section' => 'contact_info_settings',
  478. 'type' => 'text',
  479. )
  480. );
  481.  
  482. //Contact Email Setting
  483.  
  484. $wp_customize->add_setting(
  485. 'appointment_options[contact_mail_icon]', array(
  486. 'default' => 'fa-envelope',
  487. 'capability' => 'edit_theme_options',
  488. 'type' => 'option',
  489. ));
  490.  
  491. $wp_customize->add_control( 'appointment_options[contact_mail_icon]', array(
  492. 'label' => __('Contact E-Mail icon', 'appointment'),
  493. 'section' => 'contact_info_settings',
  494. 'type' => 'text',
  495. ));
  496.  
  497. $wp_customize->add_setting(
  498. 'appointment_options[contact_mail_title]',
  499. array(
  500. 'default' => __('Drop us an mail','appointment'),
  501. 'capability' => 'edit_theme_options',
  502. 'sanitize_callback' => 'appointment_sanitize_html',
  503. 'type' => 'option',
  504. )
  505. );
  506. $wp_customize->add_control(
  507. 'appointment_options[contact_mail_title]',
  508. array(
  509. 'label' => __('Contact E-Mail Title','appointment'),
  510. 'section' => 'contact_info_settings',
  511. 'type' => 'text',
  512. )
  513. );
  514.  
  515. $wp_customize->add_setting(
  516. 'appointment_options[contact_mail_description]',
  517. array(
  518. 'default' => __('info@yoursupport.com','appointment'),
  519. 'capability' => 'edit_theme_options',
  520. 'sanitize_callback' => 'sanitize_text_field',
  521. 'type' => 'option',
  522. )
  523. );
  524. $wp_customize->add_control(
  525. 'appointment_options[contact_mail_description]',
  526. array(
  527. 'label' => __('Contact E-Mail Description','appointment'),
  528. 'section' => 'contact_info_settings',
  529. 'type' => 'text',
  530. )
  531. );
  532.  
  533.  
  534.  
  535.  
  536.  
  537. //Contact Callout
  538. $wp_customize->add_section(
  539. 'contact_callout_settings',
  540. array(
  541. 'title' => __('Contact Callout Settings','appointment'),
  542. 'description' => '',
  543. 'panel' => 'appointment_template',)
  544. );
  545.  
  546.  
  547.  
  548. // enable/disable Contact Form Setting
  549. $wp_customize->add_setting(
  550. 'appointment_options[check_contact_callout]',
  551. array('capability' => 'edit_theme_options',
  552. 'type'=> 'option',
  553.  
  554. ));
  555.  
  556. $wp_customize->add_control(
  557. 'appointment_options[check_contact_callout]',
  558. array(
  559. 'type' => 'checkbox',
  560. 'label' => __('Hide Contact callout','appointment'),
  561. 'section' => 'contact_callout_settings',
  562. )
  563. );
  564.  
  565. //Form title
  566. $wp_customize->add_setting(
  567. 'appointment_options[contact_callout_title]',
  568. array(
  569. 'default' => __('Contact Info','appointment'),
  570. 'capability' => 'edit_theme_options',
  571. 'sanitize_callback' => 'appointment_sanitize_html',
  572. 'type' => 'option',
  573. )
  574. );
  575. $wp_customize->add_control( 'appointment_options[contact_callout_title]',array(
  576. 'label' => __('Contact Callout Title','appointment'),
  577. 'section' => 'contact_callout_settings',
  578. 'type' => 'text',) );
  579.  
  580. //Form Decription
  581.  
  582. $wp_customize->add_setting(
  583. 'appointment_options[contact_callout_description]',
  584. array(
  585. 'default' => __('Be creative with our template, with hundred of options and possibilities Dont miss this great opportunity and profit from this great template.','appointment'),
  586. 'capability' => 'edit_theme_options',
  587. 'sanitize_callback' => 'sanitize_text_field',
  588. 'type' => 'option',
  589. )
  590. );
  591. $wp_customize->add_control( 'appointment_options[contact_callout_description]',array(
  592. 'label' => __('Contact Description','appointment'),
  593. 'section' => 'contact_callout_settings',
  594. 'type' => 'text',) );
  595.  
  596.  
  597. $wp_customize ->add_setting (
  598. 'appointment_options[contact_callout_button]',
  599. array(
  600. 'default' => __('Buy Now!','appointment'),
  601. 'capability' => 'edit_theme_options',
  602. 'sanitize_callback' => 'sanitize_text_field' ,
  603. 'type' => 'option',
  604. )
  605. );
  606.  
  607. $wp_customize->add_control (
  608. 'appointment_options[contact_callout_button]',
  609. array (
  610. 'label' => __('Contact callout Button text','appointment'),
  611. 'section' => 'contact_callout_settings',
  612. 'type' => 'text',
  613. ) );
  614.  
  615.  
  616. $wp_customize ->add_setting (
  617. 'appointment_options[contact_callout_button_link]',
  618. array(
  619. 'default' => __('#','appointment'),
  620. 'capability' => 'edit_theme_options',
  621. 'sanitize_callback' => 'sanitize_text_field',
  622. 'type' => 'option',
  623. ) );
  624.  
  625. $wp_customize->add_control (
  626. 'appointment_options[contact_callout_button_link]',
  627. array (
  628. 'label' => __('Contact callout Button Link','appointment'),
  629. 'section' => 'contact_callout_settings',
  630. 'type' => 'text',
  631. ) );
  632.  
  633. $wp_customize->add_setting(
  634. 'appointment_options[contact_callout_link_target]',
  635. array('capability' => 'edit_theme_options',
  636. 'default' => 1,
  637. 'type' => 'option',
  638. ));
  639.  
  640. $wp_customize->add_control(
  641. 'appointment_options[contact_callout_link_target]',
  642. array(
  643. 'type' => 'checkbox',
  644. 'label' => __('Open link new tab/window','appointment'),
  645. 'section' => 'contact_callout_settings',
  646. )
  647. );
  648.  
  649. function appointment_sanitize_html( $input ) {
  650.  
  651. return force_balance_tags( $input );
  652.  
  653. }
  654. }
  655. add_action( 'customize_register', 'appointment_template_customizer' );
  656. ?>
Add Comment
Please, Sign In to add comment