Guest User

Untitled

a guest
Jan 18th, 2018
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 page settings','appointment'),
  15. 'description' => '',
  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 from About Us page','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' => __('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 themes with our customers in mind, therefore our team works hard to provide you with the best technical support.','appointment'),
  58. 'capability' => 'edit_theme_options',
  59. 'sanitize_callback' => '',
  60. 'type' => 'option' ,
  61. )
  62. );
  63. $wp_customize->add_control( 'appointment_options[about_team_description]',array(
  64. 'label' => __('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' => '',
  87. 'capability' => 'edit_theme_options',
  88. 'sanitize_callback' => '',
  89. 'type' => 'option',
  90. )
  91. );
  92. $wp_customize->add_control( new WP_team_Customize_Control( $wp_customize, 'team', array(
  93. 'section' => 'about_section_settings',
  94. ))
  95. );
  96.  
  97.  
  98.  
  99. // enable/disable client section
  100. $wp_customize->add_setting(
  101. 'appointment_options[client_section_enable]',
  102. array('capability' => 'edit_theme_options',
  103. 'type' => 'option',
  104. ));
  105.  
  106. $wp_customize->add_control(
  107. 'appointment_options[client_section_enable]',
  108. array(
  109. 'type' => 'checkbox',
  110. 'label' => __('Hide client section from About Us page','appointment'),
  111. 'section' => 'about_section_settings',
  112. )
  113. );
  114.  
  115.  
  116. // enable/disable Footer contact section
  117. $wp_customize->add_setting(
  118. 'appointment_options[footer_callout_section_enable]',
  119. array('capability' => 'edit_theme_options',
  120. 'type' => 'option',
  121. ));
  122.  
  123. $wp_customize->add_control(
  124. 'appointment_options[footer_callout_section_enable]',
  125. array(
  126. 'type' => 'checkbox',
  127. 'label' => __('Hide footer callout','appointment'),
  128. 'section' => 'about_section_settings',
  129. )
  130. );
  131.  
  132.  
  133. //enable/disable blog post meta content
  134. $wp_customize->add_section( 'blog_template' , array(
  135. 'title' => __('Blog page settings', 'appointment'),
  136. 'panel' => 'appointment_template',
  137. 'priority' => 150,
  138. ) );
  139.  
  140. $wp_customize->add_setting(
  141. 'appointment_options[blog_meta_section_settings]',
  142. array(
  143. 'default' => 0,
  144. 'capability' => 'edit_theme_options',
  145. 'type' => 'option',
  146.  
  147. )
  148. );
  149. $wp_customize->add_control(
  150. 'appointment_options[blog_meta_section_settings]',
  151. array(
  152. 'label' => __('Hide post meta from blog pages, archive pages, categories, author, etc.','appointment'),
  153. 'section' => 'blog_template',
  154. 'type' => 'checkbox',
  155. )
  156. );
  157.  
  158.  
  159. //Blog Masonry Layout setting
  160.  
  161. $wp_customize->add_setting('appointment_options[blog_masonry_column_layout]',array(
  162. 'default' => 3,
  163. 'type' => 'option',
  164. 'sanitize_callback' => '',
  165. ) );
  166.  
  167. $wp_customize->add_control('appointment_options[blog_masonry_column_layout]',array(
  168. 'type' => 'select',
  169. 'label' => __('Select Blog Masonry column layout','appointment'),
  170. 'section' => 'blog_template',
  171. 'choices' => array(1=>'1',2=> '2',3=>'3','4'=>4, 5 => '5', 6 => '6'),
  172. ) );
  173.  
  174.  
  175. // add section to manage Setting
  176. $wp_customize->add_section(
  177. 'setting_section_settings',
  178. array(
  179. 'title' => __('Service page settings','appointment'),
  180. 'description' => '',
  181. 'panel' => 'appointment_template',
  182. 'priority' => 100,
  183.  
  184. )
  185. );
  186.  
  187. // Hide testimonial on settings page
  188. $wp_customize->add_setting(
  189. 'appointment_options[hide_testimonial_setting]',
  190. array(
  191. 'default' => '',
  192. 'capability' => 'edit_theme_options',
  193. 'type' => 'option',
  194. ));
  195.  
  196. $wp_customize->add_control(
  197. 'appointment_options[hide_testimonial_setting]',
  198. array(
  199. 'label' => __('Hide Testimonial section','appointment'),
  200. 'section' => 'setting_section_settings',
  201. 'type' => 'checkbox',
  202. )
  203. );
  204.  
  205. //Hide client section on setting page
  206.  
  207. $wp_customize->add_setting(
  208. 'appointment_options[hide_client_setting]',
  209. array(
  210. 'default' => '',
  211. 'capability' => 'edit_theme_options',
  212. 'type' => 'option',
  213. )
  214. );
  215. $wp_customize->add_control(
  216. 'appointment_options[hide_client_setting]',
  217. array(
  218. 'label' => __('Hide Client section','appointment'),
  219. 'section' => 'setting_section_settings',
  220. 'type' => 'checkbox',
  221. )
  222. );
  223.  
  224. //Hide contact footer calout on setting page
  225.  
  226. $wp_customize->add_setting(
  227. 'appointment_options[hide_footer_callout_setting]',
  228. array(
  229. 'default' => '',
  230. 'capability' => 'edit_theme_options',
  231. 'type' => 'option',)
  232. );
  233. $wp_customize->add_control(
  234. 'appointment_options[hide_footer_callout_setting]',
  235. array(
  236. 'label' => __('Hide footer callout','appointment'),
  237. 'section' => 'setting_section_settings',
  238. 'type' => 'checkbox',
  239. )
  240. );
  241.  
  242. // add section to manage contact page
  243. $wp_customize->add_section(
  244. 'contact_section_settings',
  245. array(
  246. 'title' => __('Contact page setting','appointment'),
  247. 'description' => '',
  248. 'panel' => 'appointment_template',)
  249. );
  250.  
  251. //Form title
  252. $wp_customize->add_setting(
  253. 'appointment_options[send_usmessage]',
  254. array(
  255. 'default' => __('Send us a message','appointment'),
  256. 'capability' => 'edit_theme_options',
  257. 'sanitize_callback' => 'appointment_sanitize_html',
  258. 'type' => 'option',
  259. )
  260. );
  261. $wp_customize->add_control( 'appointment_options[send_usmessage]',array(
  262. 'label' => __('Contact form title','appointment'),
  263. 'section' => 'contact_section_settings',
  264. 'type' => 'text',) );
  265.  
  266. // enable/disable google map
  267. $wp_customize->add_setting(
  268. 'appointment_options[contact_google_map_enabled]',
  269. array('capability' => 'edit_theme_options',
  270. 'type' => 'option',
  271. ));
  272.  
  273. $wp_customize->add_control(
  274. 'appointment_options[contact_google_map_enabled]',
  275. array(
  276. 'type' => 'checkbox',
  277. 'label' => __('Hide Google Map','appointment'),
  278. 'section' => 'contact_section_settings',
  279. )
  280. );
  281.  
  282.  
  283. //Google map
  284. $wp_customize->add_setting(
  285. 'appointment_options[contact_google_title]',
  286. array(
  287. 'default' => __('Find the address','appointment'),
  288. 'capability' => 'edit_theme_options',
  289. 'sanitize_callback' => 'appointment_sanitize_html',
  290. 'type' => 'option'
  291. )
  292. );
  293. $wp_customize->add_control( 'appointment_options[contact_google_title]',array(
  294. 'label' => __('Contact Google Map title','appointment'),
  295. 'section' => 'contact_section_settings',
  296. 'type' => 'text',) );
  297.  
  298.  
  299. //Google Map URL
  300. $wp_customize->add_setting(
  301. 'appointment_options[contact_google_map_url]',
  302. array(
  303. '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',
  304. 'capability' => 'edit_theme_options',
  305. 'type' => 'option',
  306. )
  307. );
  308. $wp_customize->add_control( 'appointment_options[contact_google_map_url]',array(
  309. 'label' => __('Google Map URL','appointment'),
  310. 'section' => 'contact_section_settings',
  311. 'type' => 'textarea',) );
  312.  
  313.  
  314. // Add Team link
  315.  
  316. class WP_map_Customize_Control extends WP_Customize_Control {
  317. public $type = 'new_menu';
  318. /**
  319. * Render the control's content.
  320. */
  321. public function render_content() {
  322. ?>
  323. <a href="http://maps.google.com/" class="button" target="_blank"><?php _e( 'Click here to add Google Map', 'appointment' ); ?></a>
  324. <?php
  325. }
  326. }
  327.  
  328. $wp_customize->add_setting(
  329. 'map',
  330. array(
  331. 'default' => '',
  332. 'capability' => 'edit_theme_options',
  333. 'sanitize_callback' => '',
  334. 'type' => 'option'
  335. )
  336. );
  337. $wp_customize->add_control( new WP_map_Customize_Control( $wp_customize, 'map', array(
  338. 'section' => 'contact_section_settings',
  339. ))
  340. );
  341.  
  342. //Contact Information Setting
  343. $wp_customize->add_section(
  344. 'contact_info_settings',
  345. array(
  346. 'title' => __('Contact information settings','appointment'),
  347. 'description' => '',
  348. 'panel' => 'appointment_template',)
  349. );
  350.  
  351. // enable/disable Contact info setting
  352. $wp_customize->add_setting(
  353. 'appointment_options[contact-callout-enable]',
  354. array('capability' => 'edit_theme_options',
  355. 'type' => 'option',
  356. ));
  357.  
  358. $wp_customize->add_control(
  359. 'appointment_options[contact-callout-enable]',
  360. array(
  361. 'type' => 'checkbox',
  362. 'label' => __('Hide Contact Info section from Contact page','appointment'),
  363. 'section' => 'contact_info_settings',
  364. )
  365. );
  366. //Form title
  367. $wp_customize->add_setting(
  368. 'appointment_options[contact_title]',
  369. array(
  370. 'default' => __('Contact Info','appointment'),
  371. 'capability' => 'edit_theme_options',
  372. 'sanitize_callback' => 'appointment_sanitize_html',
  373. 'type' => 'option',
  374. )
  375. );
  376. $wp_customize->add_control( 'appointment_options[contact_title]',array(
  377. 'label' => __('Section title','appointment'),
  378. 'section' => 'contact_info_settings',
  379. 'type' => 'text',) );
  380.  
  381. //Form Decription
  382.  
  383. $wp_customize->add_setting(
  384. 'appointment_options[contact_description]',
  385. array(
  386. 'default' => __('Read what our customers are saying:','appointment'),
  387. 'capability' => 'edit_theme_options',
  388. 'sanitize_callback' => '',
  389. 'type' => 'option'
  390. )
  391. );
  392. $wp_customize->add_control( 'appointment_options[contact_description]',array(
  393. 'label' => __('Section description','appointment'),
  394. 'section' => 'contact_info_settings',
  395. 'type' => 'text',) );
  396.  
  397. //Contact Call-us
  398. $wp_customize->add_setting(
  399. 'appointment_options[contact_call_icon]', array(
  400. 'default' => 'fa-phone',
  401. 'capability' => 'edit_theme_options',
  402. 'type' => 'option',
  403. ));
  404.  
  405. $wp_customize->add_control( 'appointment_options[contact_call_icon]', array(
  406. 'label' => __('Icon', 'appointment'),
  407. 'section' => 'contact_info_settings',
  408. 'type' => 'text',
  409. ));
  410.  
  411. $wp_customize->add_setting(
  412. 'appointment_options[contact_call_title]',
  413. array(
  414. 'default' => __('Have a question? Call us now','appointment'),
  415. 'capability' => 'edit_theme_options',
  416. 'sanitize_callback' => 'appointment_sanitize_html',
  417. 'type' => 'option',
  418. )
  419. );
  420. $wp_customize->add_control(
  421. 'appointment_options[contact_call_title]',
  422. array(
  423. 'label' => __('Title','appointment'),
  424. 'section' => 'contact_info_settings',
  425. 'type' => 'text',
  426. )
  427. );
  428.  
  429. $wp_customize->add_setting(
  430. 'appointment_options[contact_call_description]',
  431. array(
  432. 'default' => '+82 334 843 52',
  433. 'capability' => 'edit_theme_options',
  434. 'sanitize_callback' => '',
  435. 'type' => 'option'
  436. )
  437. );
  438. $wp_customize->add_control(
  439. 'appointment_options[contact_call_description]',
  440. array(
  441. 'label' => __('Description','appointment'),
  442. 'section' => 'contact_info_settings',
  443. 'type' => 'text',
  444. )
  445. );
  446.  
  447.  
  448. //Contact Address
  449. $wp_customize->add_setting(
  450. 'appointment_options[contact_add_icon]', array(
  451. 'default' => 'fa-map-marker',
  452. 'capability' => 'edit_theme_options',
  453. 'type' => 'option',
  454. ));
  455.  
  456. $wp_customize->add_control( 'appointment_options[contact_add_icon]', array(
  457. 'label' => __('Icon', 'appointment'),
  458. 'section' => 'contact_info_settings',
  459. 'type' => 'text',
  460. ));
  461.  
  462. $wp_customize->add_setting(
  463. 'appointment_options[contact_add_title]',
  464. array(
  465. 'default' => __('Our office location','appointment'),
  466. 'capability' => 'edit_theme_options',
  467. 'sanitize_callback' => 'appointment_sanitize_html',
  468. 'type' => 'option',
  469. )
  470. );
  471. $wp_customize->add_control(
  472. 'appointment_options[contact_add_title]',
  473. array(
  474. 'label' => __('Title','appointment'),
  475. 'section' => 'contact_info_settings',
  476. 'type' => 'text',
  477. )
  478. );
  479.  
  480. $wp_customize->add_setting(
  481. 'appointment_options[contact_add_description]',
  482. array(
  483. 'default' => '3108 Evergreen Lane Washington, (USA) 90032',
  484. 'capability' => 'edit_theme_options',
  485. 'sanitize_callback' => '',
  486. 'type' => 'option',
  487. )
  488. );
  489. $wp_customize->add_control(
  490. 'appointment_options[contact_add_description]',
  491. array(
  492. 'label' => __('Description','appointment'),
  493. 'section' => 'contact_info_settings',
  494. 'type' => 'text',
  495. )
  496. );
  497.  
  498. //Contact Email Setting
  499.  
  500. $wp_customize->add_setting(
  501. 'appointment_options[contact_mail_icon]', array(
  502. 'default' => 'fa-envelope',
  503. 'capability' => 'edit_theme_options',
  504. 'type' => 'option',
  505. ));
  506.  
  507. $wp_customize->add_control( 'appointment_options[contact_mail_icon]', array(
  508. 'label' => __('Icon', 'appointment'),
  509. 'section' => 'contact_info_settings',
  510. 'type' => 'text',
  511. ));
  512.  
  513. $wp_customize->add_setting(
  514. 'appointment_options[contact_mail_title]',
  515. array(
  516. 'default' => __('Drop us a mail','appointment'),
  517. 'capability' => 'edit_theme_options',
  518. 'sanitize_callback' => 'appointment_sanitize_html',
  519. 'type' => 'option',
  520. )
  521. );
  522. $wp_customize->add_control(
  523. 'appointment_options[contact_mail_title]',
  524. array(
  525. 'label' => __('Title','appointment'),
  526. 'section' => 'contact_info_settings',
  527. 'type' => 'text',
  528. )
  529. );
  530.  
  531. $wp_customize->add_setting(
  532. 'appointment_options[contact_mail_description]',
  533. array(
  534. 'default' => 'info@yoursupport.com',
  535. 'capability' => 'edit_theme_options',
  536. 'sanitize_callback' => '',
  537. 'type' => 'option',
  538. )
  539. );
  540. $wp_customize->add_control(
  541. 'appointment_options[contact_mail_description]',
  542. array(
  543. 'label' => __('Description','appointment'),
  544. 'section' => 'contact_info_settings',
  545. 'type' => 'text',
  546. )
  547. );
  548.  
  549.  
  550.  
  551.  
  552.  
  553. //Contact Callout
  554. $wp_customize->add_section(
  555. 'contact_callout_settings',
  556. array(
  557. 'title' => __('Contact callout settings','appointment'),
  558. 'description' => '',
  559. 'panel' => 'appointment_template',)
  560. );
  561.  
  562.  
  563.  
  564. // enable/disable Contact Form Setting
  565. $wp_customize->add_setting(
  566. 'appointment_options[check_contact_callout]',
  567. array('capability' => 'edit_theme_options',
  568. 'type'=> 'option',
  569.  
  570. ));
  571.  
  572. $wp_customize->add_control(
  573. 'appointment_options[check_contact_callout]',
  574. array(
  575. 'type' => 'checkbox',
  576. 'label' => __('Hide contact callout from Contact Page','appointment'),
  577. 'section' => 'contact_callout_settings',
  578. )
  579. );
  580.  
  581. //Form title
  582. $wp_customize->add_setting(
  583. 'appointment_options[contact_callout_title]',
  584. array(
  585. 'default' => __('Contact Info','appointment'),
  586. 'capability' => 'edit_theme_options',
  587. 'sanitize_callback' => 'appointment_sanitize_html',
  588. 'type' => 'option',
  589. )
  590. );
  591. $wp_customize->add_control( 'appointment_options[contact_callout_title]',array(
  592. 'label' => __('Title','appointment'),
  593. 'section' => 'contact_callout_settings',
  594. 'type' => 'text',) );
  595.  
  596. //Form Decription
  597.  
  598. $wp_customize->add_setting(
  599. 'appointment_options[contact_callout_description]',
  600. array(
  601. 'default' => __('Be creative with our template, there are hundreds of options and possibilities. Do not miss this unique opportunity to profit from this great template.','appointment'),
  602. 'capability' => 'edit_theme_options',
  603. 'sanitize_callback' => '',
  604. 'type' => 'option',
  605. )
  606. );
  607. $wp_customize->add_control( 'appointment_options[contact_callout_description]',array(
  608. 'label' => __('Description','appointment'),
  609. 'section' => 'contact_callout_settings',
  610. 'type' => 'text',) );
  611.  
  612.  
  613. $wp_customize ->add_setting (
  614. 'appointment_options[contact_callout_button]',
  615. array(
  616. 'default' => __('Purchase Now','appointment'),
  617. 'capability' => 'edit_theme_options',
  618. 'sanitize_callback' => '' ,
  619. 'type' => 'option',
  620. )
  621. );
  622.  
  623. $wp_customize->add_control (
  624. 'appointment_options[contact_callout_button]',
  625. array (
  626. 'label' => __('Button Text','appointment'),
  627. 'section' => 'contact_callout_settings',
  628. 'type' => 'text',
  629. ) );
  630.  
  631.  
  632. $wp_customize ->add_setting (
  633. 'appointment_options[contact_callout_button_link]',
  634. array(
  635. 'default' => '#',
  636. 'capability' => 'edit_theme_options',
  637. 'sanitize_callback' => '',
  638. 'type' => 'option',
  639. ) );
  640.  
  641. $wp_customize->add_control (
  642. 'appointment_options[contact_callout_button_link]',
  643. array (
  644. 'label' => __('Button Link','appointment'),
  645. 'section' => 'contact_callout_settings',
  646. 'type' => 'text',
  647. ) );
  648.  
  649. $wp_customize->add_setting(
  650. 'appointment_options[contact_callout_link_target]',
  651. array('capability' => 'edit_theme_options',
  652. 'default' => 1,
  653. 'type' => 'option',
  654. ));
  655.  
  656. $wp_customize->add_control(
  657. 'appointment_options[contact_callout_link_target]',
  658. array(
  659. 'type' => 'checkbox',
  660. 'label' => __('Open link in new tab','appointment'),
  661. 'section' => 'contact_callout_settings',
  662. ) );
  663.  
  664. // section background image
  665. $wp_customize->add_setting( 'appointment_options[contact_callout_back]', array(
  666. 'sanitize_callback' => 'esc_url_raw',
  667. 'type' => 'option',
  668. 'default' => WEBRITI_TEMPLATE_DIR_URI . "/images/bg2.jpg",
  669. ) );
  670.  
  671. $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'appointment_options[contact_callout_back]', array(
  672. 'label' => __( 'Background Image', 'appointment' ),
  673. 'section' => 'contact_callout_settings',
  674. 'settings' => 'appointment_options[contact_callout_back]',
  675. ) ) );
  676.  
  677. // Background Position
  678. $wp_customize->add_setting( 'appointment_options[contact_attachment]', array(
  679. 'default' => 'fixed',
  680. 'sanitize_callback' => '',
  681. 'type' => 'option',
  682. ) );
  683.  
  684. $wp_customize->add_control('appointment_options[contact_attachment]', array(
  685. 'label' => __( 'Background Position', 'appointment' ),
  686. 'section' => 'contact_callout_settings',
  687. 'type' => 'select',
  688. 'choices' => array(
  689. 'fixed'=>'fixed',
  690. 'scroll'=>'scroll',
  691. ) ) );
  692.  
  693. // overlay
  694. $wp_customize->add_setting( 'appointment_options[contact_overlay]', array(
  695. 'default' => true,
  696. 'sanitize_callback' => '',
  697. 'type' => 'option',
  698. ) );
  699.  
  700. $wp_customize->add_control('appointment_options[contact_overlay]', array(
  701. 'label' => __( 'Enable overlay', 'appointment' ),
  702. 'section' => 'contact_callout_settings',
  703. 'type' => 'checkbox',
  704. ) );
  705.  
  706. function appointment_sanitize_html( $input ) {
  707.  
  708. return force_balance_tags( $input );
  709.  
  710. }
  711. }
  712. add_action( 'customize_register', 'appointment_template_customizer' );
  713. ?>
RAW Paste Data