inkthemes_Customizer

The ColorWay inkthemes Customizer class.

Defined (1)

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

/functions/customizer.php  
  1. class inkthemes_Customizer { 
  2.  
  3. public static function inkthemes_Register($wp_customize) { 
  4.  
  5. self::inkthemes_Sections($wp_customize); 
  6.  
  7. self::inkthemes_Controls($wp_customize); 
  8.  
  9. public static function inkthemes_Sections($wp_customize) { 
  10.  
  11. /** 
  12. * Add panel for home page feature area 
  13. */ 
  14. $wp_customize->add_panel('general_setting_panel', array( 
  15. 'title' => __('General Settings', 'colorway'),  
  16. 'description' => __('Allows you to setup home page feature area section for ColorWay Theme.', 'colorway'),  
  17. 'priority' => '10',  
  18. 'capability' => 'edit_theme_options' 
  19. )); 
  20.  
  21. /** 
  22. * Site Title Section 
  23. */ 
  24. $wp_customize->add_section('title_tagline', array( 
  25. 'title' => __('Site Title & Tagline', 'colorway'),  
  26. 'priority' => '',  
  27. 'panel' => 'general_setting_panel' 
  28. )); 
  29.  
  30. /** 
  31. * Remove control for site icon 
  32. */ 
  33. $wp_customize->remove_control('site_icon'); 
  34.  
  35. /** 
  36. * Logo and favicon section 
  37. */ 
  38. $wp_customize->add_section('logo_fevi_setting', array( 
  39. 'title' => __('Logo & Favicon', 'colorway'),  
  40. 'description' => __('Allows you to customize header logo, favicon settings for ColorWay Theme.', 'colorway'), //Descriptive tooltip 
  41. 'panel' => 'general_setting_panel',  
  42. 'priority' => '',  
  43. 'capability' => 'edit_theme_options' 
  44. ); 
  45.  
  46. /** 
  47. * Tracking Code Section 
  48. */ 
  49. $wp_customize->add_section('tracking_code_setting', array( 
  50. 'title' => __('Tracking Code', 'colorway'),  
  51. 'description' => __('Paste your Google Analytics (or other) tracking code here.', 'colorway'), //Descriptive tooltip 
  52. 'panel' => 'general_setting_panel',  
  53. 'priority' => '',  
  54. 'capability' => 'edit_theme_options' 
  55. ); 
  56.  
  57. /** 
  58. * Dummy Data Section 
  59. */ 
  60. $wp_customize->add_section('dummy_data_setting', array( 
  61. 'title' => __('Dummy Data', 'colorway'),  
  62. 'description' => __('Allows you to anable or disable dummy data for ColorWay Theme.', 'colorway'), //Descriptive tooltip 
  63. 'panel' => 'general_setting_panel',  
  64. 'priority' => '',  
  65. 'capability' => 'edit_theme_options' 
  66. ); 
  67.  
  68. /** 
  69. * Home page slider panel 
  70. */ 
  71. $wp_customize->add_panel('home_page_slider_panel', array( 
  72. 'title' => __('Slider Settings', 'colorway'),  
  73. 'description' => __('Allows you to setup home page slider for ColorWay Theme.', 'colorway'),  
  74. 'priority' => '11',  
  75. 'capability' => 'edit_theme_options' 
  76. )); 
  77.  
  78. /** 
  79. * Slider controle section 
  80. */ 
  81. $wp_customize->add_section('home_page_slider_control', array( 
  82. 'title' => __('Slider Control', 'colorway'),  
  83. 'description' => __('Turn on or off the home page Slider as per your requirement.', 'colorway'), //Descriptive tooltip 
  84. 'panel' => 'home_page_slider_panel',  
  85. 'priority' => '',  
  86. 'capability' => 'edit_theme_options' 
  87. ); 
  88.  
  89. /** 
  90. * First Slider section 
  91. */ 
  92. $wp_customize->add_section('home_page_slider_1', array( 
  93. 'title' => __('First Slider', 'colorway'),  
  94. 'description' => __('Allows you to setup first slider for ColorWay Theme.', 'colorway'), //Descriptive tooltip 
  95. 'panel' => 'home_page_slider_panel',  
  96. 'priority' => '',  
  97. 'capability' => 'edit_theme_options' 
  98. ); 
  99.  
  100. /** 
  101. * Second Slider section 
  102. */ 
  103. $wp_customize->add_section('home_page_slider_2', array( 
  104. 'title' => __('Second Slider', 'colorway'),  
  105. 'description' => __('Allows you to setup second slider for ColorWay Theme.', 'colorway'), //Descriptive tooltip 
  106. 'panel' => 'home_page_slider_panel',  
  107. 'priority' => '',  
  108. 'capability' => 'edit_theme_options' 
  109. ); 
  110.  
  111. /** 
  112. * Home page main heading 
  113. */ 
  114. $wp_customize->add_section('home_page_main_heading', array( 
  115. 'title' => __('Main Heading Setting', 'colorway'),  
  116. 'description' => __('Allows you to setup mani heading for ColorWay Theme.', 'colorway'), //Descriptive tooltip 
  117. 'panel' => '',  
  118. 'priority' => '12',  
  119. 'capability' => 'edit_theme_options' 
  120. ); 
  121.  
  122. /** 
  123. * Home Page Feature area panel 
  124. */ 
  125. $wp_customize->add_panel('home_feature_area_panel', array( 
  126. 'title' => __('Feature Area Settings', 'colorway'),  
  127. 'description' => __('Allows you to setup home page feature area section for ColorWay Theme.', 'colorway'),  
  128. 'priority' => '13',  
  129. 'capability' => 'edit_theme_options' 
  130. )); 
  131.  
  132. /** 
  133. * Home Page feature area 1 
  134. */ 
  135. $wp_customize->add_section('home_feature_area_1', array( 
  136. 'title' => __('First Feature Area', 'colorway'),  
  137. 'description' => __('Allows you to setup first feature area section for ColorWay Theme.', 'colorway'),  
  138. 'panel' => 'home_feature_area_panel',  
  139. 'priority' => '',  
  140. 'capability' => 'edit_theme_options' 
  141. ); 
  142.  
  143. /** 
  144. * Home Page feature area 2 
  145. */ 
  146. $wp_customize->add_section('home_feature_area_2', array( 
  147. 'title' => __('Second Feature Area', 'colorway'),  
  148. 'description' => __('Allows you to setup second feature area section for ColorWay Theme.', 'colorway'),  
  149. 'panel' => 'home_feature_area_panel',  
  150. 'priority' => '',  
  151. 'capability' => 'edit_theme_options' 
  152. ); 
  153.  
  154. /** 
  155. * Home Page feature area 3 
  156. */ 
  157. $wp_customize->add_section('home_feature_area_3', array( 
  158. 'title' => __('Third Feature Area', 'colorway'),  
  159. 'description' => __('Allows you to setup third feature area section for ColorWay Theme.', 'colorway'),  
  160. 'panel' => 'home_feature_area_panel',  
  161. 'priority' => '',  
  162. 'capability' => 'edit_theme_options' 
  163. ); 
  164.  
  165. /** 
  166. * Home Page feature area 4 
  167. */ 
  168. $wp_customize->add_section('home_feature_area_4', array( 
  169. 'title' => __('Fourth Feature Area', 'colorway'),  
  170. 'description' => __('Allows you to setup fourth feature area section for ColorWay Theme.', 'colorway'),  
  171. 'panel' => 'home_feature_area_panel',  
  172. 'priority' => '',  
  173. 'capability' => 'edit_theme_options' 
  174. ); 
  175.  
  176. /** 
  177. * Home Page Middle area panel 
  178. */ 
  179. $wp_customize->add_panel('home_middle_area_panel', array( 
  180. 'title' => __('Middle Area Settings', 'colorway'),  
  181. 'description' => __('Allows you to setup home page middle area section for ColorWay Theme.', 'colorway'),  
  182. 'priority' => '14',  
  183. 'capability' => 'edit_theme_options' 
  184. )); 
  185.  
  186. /** 
  187. * home page middle area control section 
  188. */ 
  189. $wp_customize->add_section('home_middle_area_control', array( 
  190. 'title' => __('Middel Area Control', 'colorway'),  
  191. 'description' => __('Allows you to setup home page middle area control for ColorWay Theme.', 'colorway'),  
  192. 'panel' => 'home_middle_area_panel',  
  193. 'priority' => '',  
  194. 'capability' => 'edit_theme_options' 
  195. ); 
  196. /** 
  197. * home page middle area left section 
  198. */ 
  199. $wp_customize->add_section('home_middle_area_left', array( 
  200. 'title' => __('Home Page Left Widget Heading', 'colorway'),  
  201. 'description' => __('Allows you to setup home page left widget heading for ColorWay Theme.', 'colorway'),  
  202. 'panel' => 'home_middle_area_panel',  
  203. 'priority' => '',  
  204. 'capability' => 'edit_theme_options' 
  205. ); 
  206.  
  207. /** 
  208. * home page middle area right section 
  209. */ 
  210. $wp_customize->add_section('home_middle_area_right', array( 
  211. 'title' => __('Home Page Blog Area', 'colorway'),  
  212. 'description' => __('Allows you to setup home page blog area for ColorWay Theme.', 'colorway'),  
  213. 'panel' => 'home_middle_area_panel',  
  214. 'priority' => '',  
  215. 'capability' => 'edit_theme_options' 
  216. ); 
  217.  
  218. /** 
  219. * Home Page Testimonial Area panel 
  220. */ 
  221. $wp_customize->add_panel('home_testimonial_area_panel', array( 
  222. 'title' => __('Testimonial Area Settings', 'colorway'),  
  223. 'description' => __('Allows you to setup home page testimonial area for ColorWay Theme.', 'colorway'),  
  224. 'priority' => '15',  
  225. 'capability' => 'edit_theme_options' 
  226. )); 
  227.  
  228. /** 
  229. * Home page testimonial area control section 
  230. */ 
  231. $wp_customize->add_section('home_testimonial_control', array( 
  232. 'title' => __('Testimonial Control', 'colorway'),  
  233. 'description' => __('Allows you to control testimonial section for ColorWay Theme.', 'colorway'),  
  234. 'priority' => '',  
  235. 'panel' => 'home_testimonial_area_panel' 
  236. )); 
  237.  
  238. /** 
  239. * Home page first testimonial section 
  240. */ 
  241. $wp_customize->add_section('home_testimonial_1', array( 
  242. 'title' => __('First Testimonial', 'colorway'),  
  243. 'description' => __('Allows you to setup first testimonial section for ColorWay Theme.', 'colorway'),  
  244. 'priority' => '',  
  245. 'panel' => 'home_testimonial_area_panel' 
  246. )); 
  247.  
  248. /** 
  249. * Home page second testimonial section 
  250. */ 
  251. $wp_customize->add_section('home_testimonial_2', array( 
  252. 'title' => __('Second Testimonial', 'colorway'),  
  253. 'description' => __('Allows you to setup second testimonial section for ColorWay Theme.', 'colorway'),  
  254. 'priority' => '',  
  255. 'panel' => 'home_testimonial_area_panel' 
  256. )); 
  257.  
  258. /** 
  259. * Home page third testimonial section 
  260. */ 
  261. $wp_customize->add_section('home_testimonial_3', array( 
  262. 'title' => __('Third Testimonial', 'colorway'),  
  263. 'description' => __('Allows you to setup third testimonial section for ColorWay Theme.', 'colorway'),  
  264. 'priority' => '',  
  265. 'panel' => 'home_testimonial_area_panel' 
  266. )); 
  267.  
  268. /** 
  269. * Footer Setting 
  270. */ 
  271. $wp_customize->add_section('footer_section', array( 
  272. 'title' => __('Footer Settings', 'colorway'),  
  273. 'description' => __('Allows you to setup footer social icon for ColorWay Theme.', 'colorway'),  
  274. 'priority' => '16',  
  275. 'panel' => '' 
  276. )); 
  277.  
  278. /** 
  279. * Add panel for styling option 
  280. */ 
  281. $wp_customize->add_panel('style_setting', array( 
  282. 'title' => __('Style Settings', 'colorway'),  
  283. 'description' => __('Allows you to setup Theme text and Background color for ColorWay Theme.', 'colorway'),  
  284. 'priority' => '17',  
  285. 'capability' => 'edit_theme_options' 
  286. )); 
  287.  
  288. /** 
  289. * Background color Section 
  290. */ 
  291. $wp_customize->add_section('colors', array( 
  292. 'title' => __('Background color Setting', 'colorway'),  
  293. 'description' => __('Allows you to change Background color for ColorWay Theme. This only works when no any image set as background image.', 'colorway'),  
  294. 'priority' => '',  
  295. 'panel' => 'style_setting' 
  296. )); 
  297.  
  298. /** 
  299. * Background Image Section 
  300. */ 
  301. $wp_customize->add_section('background_image', array( 
  302. 'title' => __('Background Image setting', 'colorway'),  
  303. 'description' => __('Allows you to change background image for ColorWay Theme. This will overright the background color property', 'colorway'),  
  304. 'priority' => '',  
  305. 'panel' => 'style_setting' 
  306. )); 
  307.  
  308. /** 
  309. * Text color Section 
  310. */ 
  311. $wp_customize->add_section('text_colors', array( 
  312. 'title' => __('Text color setting', 'colorway'),  
  313. 'description' => __('Allows you to change text color for ColorWay Theme.', 'colorway'),  
  314. 'priority' => '',  
  315. 'panel' => 'style_setting' 
  316. )); 
  317.  
  318. /** 
  319. * Style Section 
  320. */ 
  321. $wp_customize->add_section('style_section', array( 
  322. 'title' => __('Custom Style Setting', 'colorway'),  
  323. 'description' => __('Allows you to change style using custom css for ColorWay Theme.', 'colorway'),  
  324. 'panel' => 'style_setting',  
  325. 'priority' => '',  
  326. 'capability' => 'edit_theme_options' 
  327. ); 
  328.  
  329. public static function inkthemes_Section_Content() { 
  330.  
  331. $section_content = array( 
  332. 'logo_fevi_setting' => array( 
  333. 'colorway_logo',  
  334. 'colorway_favicon' 
  335. ),  
  336. 'tracking_code_setting' => array( 
  337. 'colorway_analytics' 
  338. ),  
  339. 'dummy_data_setting' => array( 
  340. 'colorway_dummy_data' 
  341. ),  
  342. 'home_page_slider_control' => array( 
  343. 'colorway_home_page_slider' 
  344. ),  
  345. 'home_page_slider_1' => array( 
  346. 'colorway_slideimage1',  
  347. 'colorway_slideheading1',  
  348. 'colorway_slidedescription1',  
  349. 'colorway_slidelink1' 
  350. ),  
  351. 'home_page_slider_2' => array( 
  352. 'colorway_slideimage2',  
  353. 'colorway_slideheading2',  
  354. 'colorway_slidedescription2',  
  355. 'colorway_slidelink2' 
  356. ),  
  357. 'home_page_main_heading' => array( 
  358. 'inkthemes_mainheading' 
  359. ),  
  360. 'home_feature_area_1' => array( 
  361. 'inkthemes_fimg1',  
  362. 'inkthemes_headline1',  
  363. 'inkthemes_feature1',  
  364. 'inkthemes_link1' 
  365. ),  
  366. 'home_feature_area_2' => array( 
  367. 'inkthemes_fimg2',  
  368. 'inkthemes_headline2',  
  369. 'inkthemes_feature2',  
  370. 'inkthemes_link2' 
  371. ),  
  372. 'home_feature_area_3' => array( 
  373. 'inkthemes_fimg3',  
  374. 'inkthemes_headline3',  
  375. 'inkthemes_feature3',  
  376. 'inkthemes_link3' 
  377. ),  
  378. 'home_feature_area_4' => array( 
  379. 'inkthemes_fimg4',  
  380. 'inkthemes_headline4',  
  381. 'inkthemes_feature4',  
  382. 'inkthemes_link4' 
  383. ),  
  384. 'home_middle_area_control' => array( 
  385. 'colorway_home_page_blog_post' 
  386. ),  
  387. 'home_middle_area_left' => array( 
  388. 'inkthemes_widget_head' 
  389. ),  
  390. 'home_middle_area_right' => array( 
  391. 'inkthemes_blog_head',  
  392. 'inkthemes_blog_posts' 
  393. ),  
  394. 'home_testimonial_control' => array( 
  395. 'colorway_testimonial_status',  
  396. 'inkthemes_testimonial_main_head',  
  397. 'inkthemes_testimonial_main_desc' 
  398. ),  
  399. 'home_testimonial_1' => array( 
  400. 'inkthemes_testimonial_img',  
  401. 'inkthemes_testimonial_name',  
  402. 'inkthemes_testimonial' 
  403. ),  
  404. 'home_testimonial_2' => array( 
  405. 'inkthemes_testimonial_img_2',  
  406. 'inkthemes_testimonial_name_2',  
  407. 'inkthemes_testimonial_2' 
  408. ),  
  409. 'home_testimonial_3' => array( 
  410. 'inkthemes_testimonial_img_3',  
  411. 'inkthemes_testimonial_name_3',  
  412. 'inkthemes_testimonial_3' 
  413. ),  
  414. 'footer_section' => array( 
  415. 'colorway_facebook',  
  416. 'colorway_twitter',  
  417. 'colorway_rss',  
  418. 'colorway_linkedin',  
  419. 'colorway_stumble',  
  420. 'colorway_digg' 
  421. ),  
  422. 'style_section' => array( 
  423. 'inkthemes_customcss' 
  424. ),  
  425. ); 
  426. return $section_content; 
  427.  
  428. public static function inkthemes_Settings() { 
  429.  
  430. $theme_settings = array( 
  431. 'colorway_logo' => array( 
  432. 'id' => 'inkthemes_options[colorway_logo]',  
  433. 'label' => __('Custom Logo', 'colorway'),  
  434. 'description' => __('Upload a logo for your Website. The recommended size for the logo is 215px width x 55px height.', 'colorway'),  
  435. 'type' => 'option',  
  436. 'setting_type' => 'image',  
  437. 'default' => get_template_directory_uri() . '/images/logo.png' 
  438. ),  
  439. 'colorway_favicon' => array( 
  440. 'id' => 'inkthemes_options[colorway_favicon]',  
  441. 'label' => __('Custom Favicon', 'colorway'),  
  442. 'description' => __('Here you can upload a Favicon for your Website. Specified size is 16px x 16px.', 'colorway'),  
  443. 'type' => 'option',  
  444. 'setting_type' => 'image',  
  445. 'default' => '' 
  446. ),  
  447. 'colorway_analytics' => array( 
  448. 'id' => 'inkthemes_options[colorway_analytics]',  
  449. 'label' => __('Tracking Code', 'colorway'),  
  450. 'description' => __('Paste your Google Analytics (or other) tracking code here.', 'colorway'),  
  451. 'type' => 'option',  
  452. 'setting_type' => 'textarea',  
  453. 'default' => '' 
  454. ),  
  455. 'colorway_dummy_data' => array( 
  456. 'id' => 'inkthemes_options[colorway_dummy_data]',  
  457. 'label' => __('Dummy Data', 'colorway'),  
  458. 'description' => __('Enable or Disable Dummy Data for the theme', 'colorway'),  
  459. 'type' => 'option',  
  460. 'setting_type' => 'radio',  
  461. 'default' => 'on',  
  462. 'choices' => array( 
  463. 'on' => 'On',  
  464. 'off' => 'Off' 
  465. ),  
  466. 'colorway_home_page_blog_post' => array( 
  467. 'id' => 'inkthemes_options[colorway_home_page_blog_post]',  
  468. 'label' => __('Home Page Blog post On/Off', 'colorway'),  
  469. 'description' => __('Turn on or off the home page blog post as per your requirement.', 'colorway'),  
  470. 'type' => 'option',  
  471. 'setting_type' => 'radio',  
  472. 'default' => 'on',  
  473. 'choices' => array( 
  474. 'on' => 'On',  
  475. 'off' => 'Off' 
  476. ),  
  477. 'colorway_home_page_slider' => array( 
  478. 'id' => 'inkthemes_options[colorway_home_page_slider]',  
  479. 'label' => __('Home Page Slider On/Off', 'colorway'),  
  480. 'description' => __('Turn on or off the home page Slider as per your requirement.', 'colorway'),  
  481. 'type' => 'option',  
  482. 'setting_type' => 'radio',  
  483. 'default' => 'on',  
  484. 'choices' => array( 
  485. "on" => "On",  
  486. "off" => "Off") 
  487. ),  
  488. 'colorway_slideimage1' => array( 
  489. 'id' => 'inkthemes_options[colorway_slideimage1]',  
  490. 'label' => __('First Slider Image', 'colorway'),  
  491. 'description' => __('Choose Image for your Home page First Slider. Optimal Size: 1171px x 526px', 'colorway'),  
  492. 'type' => 'option',  
  493. 'setting_type' => 'image',  
  494. 'default' => '' 
  495. ),  
  496. 'colorway_slideheading1' => array( 
  497. 'id' => 'inkthemes_options[colorway_slideheading1]',  
  498. 'label' => __('First Slider Heading', 'colorway'),  
  499. 'description' => __('Enter the Heading for Home page First slider', 'colorway'),  
  500. 'type' => 'option',  
  501. 'setting_type' => 'textarea',  
  502. 'default' => '' 
  503. ),  
  504. 'colorway_slidelink1' => array( 
  505. 'id' => 'inkthemes_options[colorway_slidelink1]',  
  506. 'label' => __('First Slide Link', 'colorway'),  
  507. 'description' => __('Enter the Link URL for Home Page First Slider', 'colorway'),  
  508. 'type' => 'option',  
  509. 'setting_type' => 'link',  
  510. 'default' => '' 
  511. ),  
  512. 'colorway_slidedescription1' => array( 
  513. 'id' => 'inkthemes_options[colorway_slidedescription1]',  
  514. 'label' => __('First Slide Description', 'colorway'),  
  515. 'description' => __('Enter the Description for Home Page First Slides Show', 'colorway'),  
  516. 'type' => 'option',  
  517. 'setting_type' => 'textarea',  
  518. 'default' => '' 
  519. ),  
  520. 'colorway_slideimage2' => array( 
  521. 'id' => 'inkthemes_options[colorway_slideimage2]',  
  522. 'label' => __('Second Slider Image', 'colorway'),  
  523. 'description' => __('Choose Image for your Home page Second Slider. Optimal Size: 1171px x 526px', 'colorway'),  
  524. 'type' => 'option',  
  525. 'setting_type' => 'image',  
  526. 'default' => '' 
  527. ),  
  528. 'colorway_slideheading2' => array( 
  529. 'id' => 'inkthemes_options[colorway_slideheading2]',  
  530. 'label' => __('Second Slider Heading', 'colorway'),  
  531. 'description' => __('Enter the Heading for Home page Second slider', 'colorway'),  
  532. 'type' => 'option',  
  533. 'setting_type' => 'textarea',  
  534. 'default' => '' 
  535. ),  
  536. 'colorway_slidelink2' => array( 
  537. 'id' => 'inkthemes_options[colorway_slidelink2]',  
  538. 'label' => __('Second Slide Link', 'colorway'),  
  539. 'description' => __('Enter the Link URL for Home Page Second Slider', 'colorway'),  
  540. 'type' => 'option',  
  541. 'setting_type' => 'link',  
  542. 'default' => '' 
  543. ),  
  544. 'colorway_slidedescription2' => array( 
  545. 'id' => 'inkthemes_options[colorway_slidedescription2]',  
  546. 'label' => __('Seocnd Slide Description', 'colorway'),  
  547. 'description' => __('Enter the Description for Home Page Second Slider', 'colorway'),  
  548. 'type' => 'option',  
  549. 'setting_type' => 'textarea',  
  550. 'default' => '' 
  551. ),  
  552. 'inkthemes_mainheading' => array( 
  553. 'id' => 'inkthemes_options[inkthemes_mainheading]',  
  554. 'label' => __('Home Page Main Heading', 'colorway'),  
  555. 'description' => __('Enter your heading text for home page', 'colorway'),  
  556. 'type' => 'option',  
  557. 'setting_type' => 'textarea',  
  558. 'default' => '' 
  559. ),  
  560. 'inkthemes_fimg1' => array( 
  561. 'id' => 'inkthemes_options[inkthemes_fimg1]',  
  562. 'label' => __('First Feature Image', 'colorway'),  
  563. 'description' => __('Choose image for your feature column first. Optimal size 198px x 115px', 'colorway'),  
  564. 'type' => 'option',  
  565. 'setting_type' => 'image',  
  566. 'default' => '' 
  567. ),  
  568. 'inkthemes_headline1' => array( 
  569. 'id' => 'inkthemes_options[inkthemes_headline1]',  
  570. 'label' => __('First Feature Heading', 'colorway'),  
  571. 'description' => __('Enter text for first feature area heading.', 'colorway'),  
  572. 'type' => 'option',  
  573. 'setting_type' => 'textarea',  
  574. 'default' => '' 
  575. ),  
  576. 'inkthemes_feature1' => array( 
  577. 'id' => 'inkthemes_options[inkthemes_feature1]',  
  578. 'label' => __('First Feature Description', 'colorway'),  
  579. 'description' => __('Enter text for first feature area description.', 'colorway'),  
  580. 'type' => 'option',  
  581. 'setting_type' => 'textarea',  
  582. 'default' => '' 
  583. ),  
  584. 'inkthemes_link1' => array( 
  585. 'id' => 'inkthemes_options[inkthemes_link1]',  
  586. 'label' => __('First feature Link', 'colorway'),  
  587. 'description' => __('Enter link url for first feature area.', 'colorway'),  
  588. 'type' => 'option',  
  589. 'setting_type' => 'link',  
  590. 'default' => '#' 
  591. ),  
  592. 'inkthemes_fimg2' => array( 
  593. 'id' => 'inkthemes_options[inkthemes_fimg2]',  
  594. 'label' => __('Second Feature Image', 'colorway'),  
  595. 'description' => __('Choose image for your feature column second. Optimal size 198px x 115px', 'colorway'),  
  596. 'type' => 'option',  
  597. 'setting_type' => 'image',  
  598. 'default' => '' 
  599. ),  
  600. 'inkthemes_headline2' => array( 
  601. 'id' => 'inkthemes_options[inkthemes_headline2]',  
  602. 'label' => __('Second Feature Heading', 'colorway'),  
  603. 'description' => __('Enter text for second feature area heading.', 'colorway'),  
  604. 'type' => 'option',  
  605. 'setting_type' => 'textarea',  
  606. 'default' => '' 
  607. ),  
  608. 'inkthemes_feature2' => array( 
  609. 'id' => 'inkthemes_options[inkthemes_feature2]',  
  610. 'label' => __('Second Feature Description', 'colorway'),  
  611. 'description' => __('Enter text for second feature area description.', 'colorway'),  
  612. 'type' => 'option',  
  613. 'setting_type' => 'textarea',  
  614. 'default' => '' 
  615. ),  
  616. 'inkthemes_link2' => array( 
  617. 'id' => 'inkthemes_options[inkthemes_link2]',  
  618. 'label' => __('Second feature Link', 'colorway'),  
  619. 'description' => __('Enter link url for second feature area.', 'colorway'),  
  620. 'type' => 'option',  
  621. 'setting_type' => 'link',  
  622. 'default' => '#' 
  623. ),  
  624. 'inkthemes_fimg3' => array( 
  625. 'id' => 'inkthemes_options[inkthemes_fimg3]',  
  626. 'label' => __('Third Feature Image', 'colorway'),  
  627. 'description' => __('Choose image for your feature column third. Optimal size 198px x 115px', 'colorway'),  
  628. 'type' => 'option',  
  629. 'setting_type' => 'image',  
  630. 'default' => '' 
  631. ),  
  632. 'inkthemes_headline3' => array( 
  633. 'id' => 'inkthemes_options[inkthemes_headline3]',  
  634. 'label' => __('Third Feature Heading', 'colorway'),  
  635. 'description' => __('Enter text for third feature area heading.', 'colorway'),  
  636. 'type' => 'option',  
  637. 'setting_type' => 'textarea',  
  638. 'default' => '' 
  639. ),  
  640. 'inkthemes_feature3' => array( 
  641. 'id' => 'inkthemes_options[inkthemes_feature3]',  
  642. 'label' => __('Third Feature Description', 'colorway'),  
  643. 'description' => __('Enter text for third feature area description.', 'colorway'),  
  644. 'type' => 'option',  
  645. 'setting_type' => 'textarea',  
  646. 'default' => '' 
  647. ),  
  648. 'inkthemes_link3' => array( 
  649. 'id' => 'inkthemes_options[inkthemes_link3]',  
  650. 'label' => __('Third feature Link', 'colorway'),  
  651. 'description' => __('Enter link url for third feature area.', 'colorway'),  
  652. 'type' => 'option',  
  653. 'setting_type' => 'link',  
  654. 'default' => '#' 
  655. ),  
  656. 'inkthemes_fimg4' => array( 
  657. 'id' => 'inkthemes_options[inkthemes_fimg4]',  
  658. 'label' => __('Fourth Feature Image', 'colorway'),  
  659. 'description' => __('Choose image for your feature column fourth. Optimal size 198px x 115px', 'colorway'),  
  660. 'type' => 'option',  
  661. 'setting_type' => 'image',  
  662. 'default' => '' 
  663. ),  
  664. 'inkthemes_headline4' => array( 
  665. 'id' => 'inkthemes_options[inkthemes_headline4]',  
  666. 'label' => __('Fourth Feature Heading', 'colorway'),  
  667. 'description' => __('Enter text for fourth feature area heading.', 'colorway'),  
  668. 'type' => 'option',  
  669. 'setting_type' => 'textarea',  
  670. 'default' => '' 
  671. ),  
  672. 'inkthemes_feature4' => array( 
  673. 'id' => 'inkthemes_options[inkthemes_feature4]',  
  674. 'label' => __('Fourth Feature Description', 'colorway'),  
  675. 'description' => __('Enter text for fourth feature area description.', 'colorway'),  
  676. 'type' => 'option',  
  677. 'setting_type' => 'textarea',  
  678. 'default' => '' 
  679. ),  
  680. 'inkthemes_link4' => array( 
  681. 'id' => 'inkthemes_options[inkthemes_link4]',  
  682. 'label' => __('Fourth feature Link', 'colorway'),  
  683. 'description' => __('Enter link url for fourth feature area.', 'colorway'),  
  684. 'type' => 'option',  
  685. 'setting_type' => 'link',  
  686. 'default' => '#' 
  687. ),  
  688. 'inkthemes_widget_head' => array( 
  689. 'id' => 'inkthemes_options[inkthemes_widget_head]',  
  690. 'label' => __('Home Page Widget Heading', 'colorway'),  
  691. 'description' => __('Enter your text for homepage Widget heading.', 'colorway'),  
  692. 'type' => 'option',  
  693. 'setting_type' => 'textarea',  
  694. 'default' => '' 
  695. ),  
  696. 'inkthemes_blog_head' => array( 
  697. 'id' => 'inkthemes_options[inkthemes_blog_head]',  
  698. 'label' => __('Home Page Blog Heading', 'colorway'),  
  699. 'description' => __('Enter your text for home Page blog heading section', 'colorway'),  
  700. 'type' => 'option',  
  701. 'setting_type' => 'textarea',  
  702. 'default' => '' 
  703. ),  
  704. 'inkthemes_blog_posts' => array( 
  705. 'id' => 'inkthemes_options[inkthemes_blog_posts]',  
  706. 'label' => __('Home Page Blog Posts', 'colorway'),  
  707. 'description' => __('Enter Number of Post you want to show on Home page.', 'colorway'),  
  708. 'type' => 'option',  
  709. 'setting_type' => 'number',  
  710. 'default' => '' 
  711. ),  
  712. 'colorway_testimonial_status' => array( 
  713. 'id' => 'inkthemes_options[colorway_testimonial_status]',  
  714. 'label' => __('Testimonial Section On/Off', 'colorway'),  
  715. 'description' => __('Turn on or off the home page testimonial section as per your requirement.', 'colorway'),  
  716. 'type' => 'option',  
  717. 'setting_type' => 'radio',  
  718. 'default' => 'on',  
  719. 'choices' => array( 
  720. 'on' => 'On',  
  721. 'off' => 'Off' 
  722. ),  
  723. 'inkthemes_testimonial_main_head' => array( 
  724. 'id' => 'inkthemes_options[inkthemes_testimonial_main_head]',  
  725. 'label' => __('Testimonial Main Heading', 'colorway'),  
  726. 'description' => __('Here mention the text testimonial Section Main Description', 'colorway'),  
  727. 'type' => 'option',  
  728. 'setting_type' => 'textarea',  
  729. 'default' => '' 
  730. ),  
  731. 'inkthemes_testimonial_main_desc' => array( 
  732. 'id' => 'inkthemes_options[inkthemes_testimonial_main_desc]',  
  733. 'label' => __('Testimonial Main Description', 'colorway'),  
  734. 'description' => __('Here mention the text testimonial Section Description', 'colorway'),  
  735. 'type' => 'option',  
  736. 'setting_type' => 'textarea',  
  737. 'default' => '' 
  738. ),  
  739. 'inkthemes_testimonial' => array( 
  740. 'id' => 'inkthemes_options[inkthemes_testimonial]',  
  741. 'label' => __('First Testimonial Description', 'colorway'),  
  742. 'description' => __('Here mention the first testimonial description of client', 'colorway'),  
  743. 'type' => 'option',  
  744. 'setting_type' => 'textarea',  
  745. 'default' => '' 
  746. ),  
  747. 'inkthemes_testimonial_img' => array( 
  748. 'id' => 'inkthemes_options[inkthemes_testimonial_img]',  
  749. 'label' => __('First Testimonial Image', 'colorway'),  
  750. 'description' => __('Here mention the first testimonial Image of client', 'colorway'),  
  751. 'type' => 'option',  
  752. 'setting_type' => 'image',  
  753. 'default' => '' 
  754. ),  
  755. 'inkthemes_testimonial_name' => array( 
  756. 'id' => 'inkthemes_options[inkthemes_testimonial_name]',  
  757. 'label' => __('First Testimonial Name', 'colorway'),  
  758. 'description' => __('Here mention the name of testimonial name of client', 'colorway'),  
  759. 'type' => 'option',  
  760. 'setting_type' => 'textarea',  
  761. 'default' => '' 
  762. ),  
  763. 'inkthemes_testimonial_2' => array( 
  764. 'id' => 'inkthemes_options[inkthemes_testimonial_2]',  
  765. 'label' => __('Second Testimonial Description', 'colorway'),  
  766. 'description' => __('Here mention the Second testimonial description of client', 'colorway'),  
  767. 'type' => 'option',  
  768. 'setting_type' => 'textarea',  
  769. 'default' => '' 
  770. ),  
  771. 'inkthemes_testimonial_img_2' => array( 
  772. 'id' => 'inkthemes_options[inkthemes_testimonial_img_2]',  
  773. 'label' => __('Second Testimonial Image', 'colorway'),  
  774. 'description' => __('Here mention the Second testimonial Image of client', 'colorway'),  
  775. 'type' => 'option',  
  776. 'setting_type' => 'image',  
  777. 'default' => '' 
  778. ),  
  779. 'inkthemes_testimonial_name_2' => array( 
  780. 'id' => 'inkthemes_options[inkthemes_testimonial_name_2]',  
  781. 'label' => __('Second Testimonial Name', 'colorway'),  
  782. 'description' => __('Here mention the name of testimonial name of client', 'colorway'),  
  783. 'type' => 'option',  
  784. 'setting_type' => 'textarea',  
  785. 'default' => '' 
  786. ),  
  787. 'inkthemes_testimonial_3' => array( 
  788. 'id' => 'inkthemes_options[inkthemes_testimonial_3]',  
  789. 'label' => __('Third Testimonial Description', 'colorway'),  
  790. 'description' => __('Here mention the Third testimonial description of client', 'colorway'),  
  791. 'type' => 'option',  
  792. 'setting_type' => 'textarea',  
  793. 'default' => '' 
  794. ),  
  795. 'inkthemes_testimonial_img_3' => array( 
  796. 'id' => 'inkthemes_options[inkthemes_testimonial_img_3]',  
  797. 'label' => __('Third Testimonial Image', 'colorway'),  
  798. 'description' => __('Here mention the Third testimonial Image of client', 'colorway'),  
  799. 'type' => 'option',  
  800. 'setting_type' => 'image',  
  801. 'default' => '' 
  802. ),  
  803. 'inkthemes_testimonial_name_3' => array( 
  804. 'id' => 'inkthemes_options[inkthemes_testimonial_name_3]',  
  805. 'label' => __('Third Testimonial Name', 'colorway'),  
  806. 'description' => __('Here mention the name of testimonial name of client', 'colorway'),  
  807. 'type' => 'option',  
  808. 'setting_type' => 'textarea',  
  809. 'default' => '' 
  810. ),  
  811. 'colorway_facebook' => array( 
  812. 'id' => 'inkthemes_options[colorway_facebook]',  
  813. 'label' => __('Facebook URL', 'colorway'),  
  814. 'description' => __('Enter your Facebook URL if you have one', 'colorway'),  
  815. 'type' => 'option',  
  816. 'setting_type' => 'link',  
  817. 'default' => '' 
  818. ),  
  819. 'colorway_twitter' => array( 
  820. 'id' => 'inkthemes_options[colorway_twitter]',  
  821. 'label' => __('Twitter URL', 'colorway'),  
  822. 'description' => __('Enter your Twitter URL if you have one', 'colorway'),  
  823. 'type' => 'option',  
  824. 'setting_type' => 'link',  
  825. 'default' => '' 
  826. ),  
  827. 'colorway_rss' => array( 
  828. 'id' => 'inkthemes_options[colorway_rss]',  
  829. 'label' => __('RSS Feed URL', 'colorway'),  
  830. 'description' => __('Enter your RSS Feed URL if you have one', 'colorway'),  
  831. 'type' => 'option',  
  832. 'setting_type' => 'link',  
  833. 'default' => '' 
  834. ),  
  835. 'colorway_linkedin' => array( 
  836. 'id' => 'inkthemes_options[colorway_linkedin]',  
  837. 'label' => __('Linked In URL', 'colorway'),  
  838. 'description' => __('Enter your Linkedin URL if you have one', 'colorway'),  
  839. 'type' => 'option',  
  840. 'setting_type' => 'link',  
  841. 'default' => '' 
  842. ),  
  843. 'colorway_stumble' => array( 
  844. 'id' => 'inkthemes_options[colorway_stumble]',  
  845. 'label' => __('Stumble Upon URL', 'colorway'),  
  846. 'description' => __('Enter your Stumble Upon URL if you have one', 'colorway'),  
  847. 'type' => 'option',  
  848. 'setting_type' => 'link',  
  849. 'default' => '' 
  850. ),  
  851. 'colorway_digg' => array( 
  852. 'id' => 'inkthemes_options[colorway_digg]',  
  853. 'label' => __('Digg URL', 'colorway'),  
  854. 'description' => __('Enter your Stumble Upon URL if you have one', 'colorway'),  
  855. 'type' => 'option',  
  856. 'setting_type' => 'link',  
  857. 'default' => '' 
  858. ),  
  859. 'inkthemes_customcss' => array( 
  860. 'id' => 'inkthemes_options[inkthemes_customcss]',  
  861. 'label' => __('Custom CSS', 'colorway'),  
  862. 'description' => __('Quickly add your custom CSS code to your theme by writing the code in this block.', 'colorway'),  
  863. 'type' => 'option',  
  864. 'setting_type' => 'textarea',  
  865. 'default' => '' 
  866. ); 
  867. return $theme_settings; 
  868.  
  869. public static function inkthemes_Controls($wp_customize) { 
  870.  
  871. $sections = self::inkthemes_Section_Content(); 
  872. $settings = self::inkthemes_Settings(); 
  873.  
  874. foreach ($sections as $section_id => $section_content) { 
  875.  
  876. foreach ($section_content as $section_content_id) { 
  877.  
  878. switch ($settings[$section_content_id]['setting_type']) { 
  879. case 'image': 
  880. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_url'); 
  881. $wp_customize->add_control(new WP_Customize_Image_Control( 
  882. $wp_customize, $settings[$section_content_id]['id'], array( 
  883. 'label' => $settings[$section_content_id]['label'],  
  884. 'description' => $settings[$section_content_id]['description'],  
  885. 'section' => $section_id,  
  886. 'settings' => $settings[$section_content_id]['id'] 
  887. )); 
  888. break; 
  889.  
  890. case 'text': 
  891. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_text'); 
  892.  
  893. $wp_customize->add_control(new WP_Customize_Control( 
  894. $wp_customize, $settings[$section_content_id]['id'], array( 
  895. 'label' => $settings[$section_content_id]['label'],  
  896. 'description' => $settings[$section_content_id]['description'],  
  897. 'section' => $section_id,  
  898. 'settings' => $settings[$section_content_id]['id'],  
  899. 'type' => 'text' 
  900. )); 
  901. break; 
  902.  
  903. case 'textarea': 
  904.  
  905. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_textarea'); 
  906.  
  907. $wp_customize->add_control(new WP_Customize_Control( 
  908. $wp_customize, $settings[$section_content_id]['id'], array( 
  909. 'label' => $settings[$section_content_id]['label'],  
  910. 'description' => $settings[$section_content_id]['description'],  
  911. 'section' => $section_id,  
  912. 'settings' => $settings[$section_content_id]['id'],  
  913. 'type' => 'textarea' 
  914. )); 
  915. break; 
  916.  
  917. case 'link': 
  918.  
  919. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_url'); 
  920.  
  921. $wp_customize->add_control(new WP_Customize_Control( 
  922. $wp_customize, $settings[$section_content_id]['id'], array( 
  923. 'label' => $settings[$section_content_id]['label'],  
  924. 'description' => $settings[$section_content_id]['description'],  
  925. 'section' => $section_id,  
  926. 'settings' => $settings[$section_content_id]['id'],  
  927. 'type' => 'text' 
  928. )); 
  929. break; 
  930.  
  931. case 'color': 
  932.  
  933. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_color'); 
  934.  
  935. $wp_customize->add_control(new WP_Customize_Color_Control( 
  936. $wp_customize, $settings[$section_content_id]['id'], array( 
  937. 'label' => $settings[$section_content_id]['label'],  
  938. 'description' => $settings[$section_content_id]['description'],  
  939. 'section' => $section_id,  
  940. 'settings' => $settings[$section_content_id]['id'] 
  941. )); 
  942. break; 
  943.  
  944. case 'number': 
  945.  
  946. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_number'); 
  947.  
  948. $wp_customize->add_control(new WP_Customize_Control( 
  949. $wp_customize, $settings[$section_content_id]['id'], array( 
  950. 'label' => $settings[$section_content_id]['label'],  
  951. 'description' => $settings[$section_content_id]['description'],  
  952. 'section' => $section_id,  
  953. 'settings' => $settings[$section_content_id]['id'],  
  954. 'type' => 'text' 
  955. )); 
  956. break; 
  957.  
  958. case 'select': 
  959.  
  960. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_select'); 
  961.  
  962. $wp_customize->add_control(new WP_Customize_Control( 
  963. $wp_customize, $settings[$section_content_id]['id'], array( 
  964. 'label' => $settings[$section_content_id]['label'],  
  965. 'description' => $settings[$section_content_id]['description'],  
  966. 'section' => $section_id,  
  967. 'settings' => $settings[$section_content_id]['id'],  
  968. 'type' => 'select',  
  969. 'choices' => $settings[$section_content_id]['choices'] 
  970. )); 
  971. break; 
  972.  
  973. case 'radio': 
  974.  
  975. self::add_setting($wp_customize, $settings[$section_content_id]['id'], $settings[$section_content_id]['default'], $settings[$section_content_id]['type'], 'inkthemes_sanitize_radio'); 
  976.  
  977. $wp_customize->add_control(new WP_Customize_Control( 
  978. $wp_customize, $settings[$section_content_id]['id'], array( 
  979. 'label' => $settings[$section_content_id]['label'],  
  980. 'description' => $settings[$section_content_id]['description'],  
  981. 'section' => $section_id,  
  982. 'settings' => $settings[$section_content_id]['id'],  
  983. 'type' => 'radio',  
  984. 'choices' => $settings[$section_content_id]['choices'] 
  985. )); 
  986. break; 
  987.  
  988. default: 
  989. break; 
  990.  
  991. public static function add_setting($wp_customize, $setting_id, $default, $type, $sanitize_callback) { 
  992. $wp_customize->add_setting($setting_id, array( 
  993. 'default' => $default,  
  994. 'capability' => 'edit_theme_options',  
  995. 'sanitize_callback' => array('inkthemes_Customizer', $sanitize_callback),  
  996. 'type' => $type 
  997. ); 
  998.  
  999. /** 
  1000. * adds sanitization callback funtion : textarea 
  1001. * @package inkthemes 
  1002. */ 
  1003. public static function inkthemes_sanitize_textarea($value) { 
  1004. $value = esc_html($value); 
  1005. return $value; 
  1006.  
  1007. /** 
  1008. * adds sanitization callback funtion : url 
  1009. * @package inkthemes 
  1010. */ 
  1011. public static function inkthemes_sanitize_url($value) { 
  1012. $value = esc_url($value); 
  1013. return $value; 
  1014.  
  1015. /** 
  1016. * adds sanitization callback funtion : text 
  1017. * @package inkthemes 
  1018. */ 
  1019. public static function inkthemes_sanitize_text($value) { 
  1020. $value = sanitize_text_field($value); 
  1021. return $value; 
  1022.  
  1023. /** 
  1024. * adds sanitization callback funtion : email 
  1025. * @package inkthemes 
  1026. */ 
  1027. public static function inkthemes_sanitize_email($value) { 
  1028. $value = sanitize_email($value); 
  1029. return $value; 
  1030.  
  1031. /** 
  1032. * adds sanitization callback funtion : number 
  1033. * @package inkthemes 
  1034. */ 
  1035. public static function inkthemes_sanitize_number($value) { 
  1036. $value = preg_replace("/[^0-9+ ]/", "", $value); 
  1037. return $value; 
  1038.  
  1039. /** 
  1040. * adds sanitization callback funtion : number 
  1041. * @package inkthemes 
  1042. */ 
  1043. public static function inkthemes_sanitize_color($value) { 
  1044. $value = sanitize_hex_color($value); 
  1045. return $value; 
  1046.  
  1047. /** 
  1048. * adds sanitization callback funtion : select 
  1049. * @package inkthemes 
  1050. */ 
  1051. public static function inkthemes_sanitize_select($value, $setting) { 
  1052. global $wp_customize; 
  1053. $control = $wp_customize->get_control($setting->id); 
  1054. if (array_key_exists($value, $control->choices)) { 
  1055. return $value; 
  1056. } else { 
  1057. return $setting->default; 
  1058.  
  1059. /** 
  1060. * adds sanitization callback funtion : radio 
  1061. * @package inkthemes 
  1062. */ 
  1063. public static function inkthemes_sanitize_radio($value, $setting) { 
  1064. global $wp_customize; 
  1065. $control = $wp_customize->get_control($setting->id); 
  1066. if (array_key_exists($value, $control->choices)) { 
  1067. return $value; 
  1068. } else { 
  1069. return $setting->default; 
  1070.