responsive_II_theme_options_set

Set Theme Options.

Description

responsive_II_theme_options_set(); 

Usage

  1. if ( !function_exists( 'responsive_II_theme_options_set' ) ) { 
  2. require_once '/includes/functions-theme-options.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = responsive_II_theme_options_set(); 
  7.  

Defined (1)

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

/includes/functions-theme-options.php  
  1. function responsive_II_theme_options_set() 
  2.  
  3. /** 
  4. * Creates and array of sections and each section again conatains array of options. 
  5. * @key This must match the id of the section you want the options to appear in 
  6. * Attributes of each sections :- 
  7. * @title - Title of the section. This text is used to be displyed as the section name in the theme theme option page. 
  8. * @fields - This is an array of option fields inside a section. 
  9. * Attributes of each fields :- 
  10. * @title Title on the left hand side of the options 
  11. * @subtitle Displays underneath main title on left hand side 
  12. * @heading Right hand side above input 
  13. * @type The type of input e.g. text, textarea, checkbox 
  14. * @id The options id 
  15. * @description Instructions on what to enter in input 
  16. * @placeholder The placeholder for text and textarea 
  17. * @options array used by select dropdown lists 
  18. */ 
  19. $options = array( 
  20. 'theme_elements' => array( 
  21. 'title' => __( 'Theme Elements', 'responsive-II' ),  
  22. 'fields' => array( 
  23. array( 
  24. 'title' => __( 'Disable breadcrumb list?', 'responsive-II' ),  
  25. 'type' => 'checkbox',  
  26. 'id' => 'breadcrumb',  
  27. 'description' => __( 'Check to disable', 'responsive-II' ),  
  28. 'default' => false,  
  29. 'validate' => 'checkbox' 
  30. ),  
  31. array( 
  32. 'title' => __( 'Use minified CSS', 'responsive-II' ),  
  33. 'type' => 'checkbox',  
  34. 'id' => 'minified_css',  
  35. 'description' => __( 'Check to disable', 'responsive-II' ),  
  36. 'default' => false,  
  37. 'validate' => 'checkbox' 
  38. ),  
  39. array( 
  40. 'title' => __( 'Disable Call to Action Button?', 'responsive-II' ),  
  41. 'type' => 'checkbox',  
  42. 'id' => 'cta_button',  
  43. 'description' => __( 'Check to disable', 'responsive-II' ),  
  44. 'default' => false,  
  45. 'validate' => 'checkbox' 
  46. ),  
  47. 'logo_upload' => array( 
  48. 'title' => __( 'Logo Upload', 'responsive-II' ),  
  49. 'fields' => array( 
  50. array( 
  51. 'title' => __( 'Custom Header', 'responsive-II' ),  
  52. 'type' => 'description',  
  53. 'id' => 'logo_upload_desc',  
  54. 'description' => __( 'Need to replace or remove default logo?', 'responsive-II' ) . ' <a href="' . admin_url( 'themes.php?page=custom-header' ) . '">' . __( 'Click here', 'responsive-II' ) . '</a>',  
  55. 'default' => '' 
  56. ),  
  57. 'home_page' => array( 
  58. 'title' => __( 'Home Page', 'responsive-II' ),  
  59. 'fields' => array( 
  60. array( 
  61. 'title' => __( 'Enable Custom Front Page', 'responsive-II' ),  
  62. 'type' => 'checkbox',  
  63. 'id' => 'front_page',  
  64. 'description' => sprintf( __( 'Overrides the WordPress %1sfront page option%2s', 'responsive-II' ), '<a href="options-reading.php">', '</a>' ),  
  65. 'default' => 1,  
  66. 'validate' => 'checkbox' 
  67. ),  
  68. array( 
  69. 'title' => __( 'Headline', 'responsive-II' ),  
  70. 'subtitle' => '',  
  71. 'heading' => '',  
  72. 'type' => 'text',  
  73. 'id' => 'home_headline',  
  74. 'description' => __( 'Enter your headline', 'responsive-II' ),  
  75. 'placeholder' => __( 'Hello, World!', 'responsive-II' ),  
  76. 'default' => '',  
  77. 'validate' => 'text' 
  78. ),  
  79. array( 
  80. 'title' => __( 'Subheadline', 'responsive-II' ),  
  81. 'type' => 'text',  
  82. 'id' => 'home_subheadline',  
  83. 'description' => __( 'Enter your subheadline', 'responsive-II' ),  
  84. 'placeholder' => __( 'Your H2 subheadline here', 'responsive-II' ),  
  85. 'default' => '',  
  86. 'validate' => 'text' 
  87. ),  
  88. array( 
  89. 'title' => __( 'Content Area', 'responsive-II' ),  
  90. 'type' => 'editor',  
  91. 'id' => 'home_content_area',  
  92. 'description' => __( 'Enter your content', 'responsive-II' ),  
  93. 'placeholder' => __( 'Your title, subtitle and this very content is editable from Theme Option. Call to Action button and its destination link as well. Image on your right can be an image or even YouTube video if you like.', 'responsive-II' ),  
  94. 'default' => '',  
  95. 'validate' => 'editor' 
  96. ),  
  97. array( 
  98. 'title' => __( 'Call to Action (URL)', 'responsive-II' ),  
  99. 'type' => 'text',  
  100. 'id' => 'cta_url',  
  101. 'description' => __( 'Enter your call to action URL', 'responsive-II' ),  
  102. 'placeholder' => '#nogo',  
  103. 'default' => '',  
  104. 'validate' => 'url' 
  105. ),  
  106. array( 
  107. 'title' => __( 'Call to Action (Text)', 'responsive-II' ),  
  108. 'type' => 'text',  
  109. 'id' => 'cta_text',  
  110. 'description' => __( 'Enter your call to action text', 'responsive-II' ),  
  111. 'placeholder' => __( 'Call to Action', 'responsive-II' ),  
  112. 'default' => '',  
  113. 'validate' => 'text' 
  114. ),  
  115. array( 
  116. 'title' => __( 'Featured Content', 'responsive-II' ),  
  117. 'subtitle' => '<a class="help-links" href="' . esc_url( 'http://cyberchimps.com/guide/responsive/' ) . '" title="' . esc_attr__( 'See Docs', 'responsive-II' ) . '" target="_blank">' . 
  118. __( 'See Docs', 'responsive-II' ) . '</a>',  
  119. 'type' => 'editor',  
  120. 'id' => 'featured_content',  
  121. 'description' => __( 'Paste your shortcode, video or image source', 'responsive-II' ),  
  122. 'placeholder' => '<img class="aligncenter" src="' . get_template_directory_uri() . '"/core/images/featured-image.png" width="440" height="300" alt="" />',  
  123. 'default' => '',  
  124. 'validate' => 'editor' 
  125. ),  
  126. 'layouts' => array( 
  127. 'title' => __( 'Default Layouts', 'responsive-II' ),  
  128. 'fields' => array( 
  129. array( 
  130. 'title' => __( 'Default Static Page Layout', 'responsive-II' ),  
  131. 'type' => 'select',  
  132. 'id' => 'static_page_layout_default',  
  133. 'options' => responsive_II_valid_layouts(),  
  134. 'default' => 'default',  
  135. 'validate' => 'select' 
  136. ),  
  137. array( 
  138. 'title' => __( 'Default Single Blog Post Layout', 'responsive-II' ),  
  139. 'type' => 'select',  
  140. 'id' => 'single_post_layout_default',  
  141. 'options' => responsive_II_valid_layouts(),  
  142. 'default' => 'default',  
  143. 'validate' => 'select' 
  144. ),  
  145. array( 
  146. 'title' => __( 'Default Blog Posts Index Layout', 'responsive-II' ),  
  147. 'type' => 'select',  
  148. 'id' => 'blog_posts_index_layout_default',  
  149. 'options' => responsive_II_valid_layouts(),  
  150. 'default' => 'default',  
  151. 'validate' => 'select' 
  152. ),  
  153. 'social' => array( 
  154. 'title' => __( 'Social Icons', 'responsive-II' ),  
  155. 'fields' => array( 
  156. array( 
  157. 'title' => __( 'Twitter', 'responsive-II' ),  
  158. 'type' => 'text',  
  159. 'id' => 'twitter_uid',  
  160. 'description' => __( 'Enter your Twitter URL', 'responsive-II' ),  
  161. 'default' => '',  
  162. 'validate' => 'url' 
  163. ),  
  164. array( 
  165. 'title' => __( 'Facebook', 'responsive-II' ),  
  166. 'type' => 'text',  
  167. 'id' => 'facebook_uid',  
  168. 'description' => __( 'Enter your Facebook URL', 'responsive-II' ),  
  169. 'default' => '',  
  170. 'validate' => 'url' 
  171. ),  
  172. array( 
  173. 'title' => __( 'LinkedIn', 'responsive-II' ),  
  174. 'type' => 'text',  
  175. 'id' => 'linkedin_uid',  
  176. 'description' => __( 'Enter your LinkedIn URL', 'responsive-II' ),  
  177. 'default' => '',  
  178. 'validate' => 'url' 
  179. ),  
  180. array( 
  181. 'title' => __( 'YouTube', 'responsive-II' ),  
  182. 'type' => 'text',  
  183. 'id' => 'youtube_uid',  
  184. 'description' => __( 'Enter your YouTube URL', 'responsive-II' ),  
  185. 'default' => '',  
  186. 'validate' => 'url' 
  187. ),  
  188. array( 
  189. 'title' => __( 'StumbleUpon', 'responsive-II' ),  
  190. 'type' => 'text',  
  191. 'id' => 'stumbleupon_uid',  
  192. 'description' => __( 'Enter your StumbleUpon URL', 'responsive-II' ),  
  193. 'default' => '',  
  194. 'validate' => 'url' 
  195. ),  
  196. array( 
  197. 'title' => __( 'RSS Feed', 'responsive-II' ),  
  198. 'type' => 'text',  
  199. 'id' => 'rss_uid',  
  200. 'description' => __( 'Enter your RSS Feed URL', 'responsive-II' ),  
  201. 'default' => '',  
  202. 'validate' => 'checkbox' 
  203. ),  
  204. array( 
  205. 'title' => __( 'Google+', 'responsive-II' ),  
  206. 'type' => 'text',  
  207. 'id' => 'googleplus_uid',  
  208. 'description' => __( 'Enter your Google+ URL', 'responsive-II' ),  
  209. 'default' => '',  
  210. 'validate' => 'url' 
  211. ),  
  212. array( 
  213. 'title' => __( 'Instagram', 'responsive-II' ),  
  214. 'type' => 'text',  
  215. 'id' => 'instagram_uid',  
  216. 'description' => __( 'Enter your Instagram URL', 'responsive-II' ),  
  217. 'default' => '',  
  218. 'validate' => 'url' 
  219. ),  
  220. array( 
  221. 'title' => __( 'Pinterest', 'responsive-II' ),  
  222. 'type' => 'text',  
  223. 'id' => 'pinterest_uid',  
  224. 'description' => __( 'Enter your Pinterest URL', 'responsive-II' ),  
  225. 'default' => '',  
  226. 'validate' => 'url' 
  227. ),  
  228. // TODO removed as no font icon for this yet 
  229. // array( 
  230. // 'title' => __( 'Yelp!', 'responsive-II' ),  
  231. // 'type' => 'text',  
  232. // 'id' => 'yelp_uid',  
  233. // 'description' => __( 'Enter your Yelp! URL', 'responsive-II' ),  
  234. // 'default' => '',  
  235. // 'validate' => 'url' 
  236. // ),  
  237. array( 
  238. 'title' => __( 'Vimeo', 'responsive-II' ),  
  239. 'type' => 'text',  
  240. 'id' => 'vimeo_uid',  
  241. 'description' => __( 'Enter your Vimeo URL', 'responsive-II' ),  
  242. 'default' => '',  
  243. 'validate' => 'url' 
  244. ),  
  245. array( 
  246. 'title' => __( 'foursquare', 'responsive-II' ),  
  247. 'type' => 'text',  
  248. 'id' => 'foursquare_uid',  
  249. 'description' => __( 'Enter your foursquare URL', 'responsive-II' ),  
  250. 'default' => '',  
  251. 'validate' => 'url' 
  252. ),  
  253. 'css' => array( 
  254. 'title' => __( 'CSS Styles', 'responsive-II' ),  
  255. 'fields' => array( 
  256. array( 
  257. 'title' => __( 'Custom CSS Styles', 'responsive-II' ),  
  258. 'subtitle' => '<a class="help-links" href="https://developer.mozilla.org/en/CSS" title="CSS Tutorial" target="_blank">' . __( 'CSS Tutorial', 'responsive-II' ) . '</a>',  
  259. 'type' => 'textarea',  
  260. 'description' => __( 'Enter your custom CSS styles.', 'responsive-II' ),  
  261. 'default' => '',  
  262. 'validate' => 'css' 
  263. ),  
  264. 'scripts' => array( 
  265. 'title' => __( 'Scripts', 'responsive-II' ),  
  266. 'fields' => array( 
  267. array( 
  268. 'title' => __( 'Custom Scripts for Header and Footer', 'responsive-II' ),  
  269. 'subtitle' => '<a class="help-links" href="http://codex.wordpress.org/Using_Javascript" title="Quick Tutorial" target="_blank">' . __( 'Quick Tutorial', 'responsive-II' ) . '</a>',  
  270. 'heading' => __( 'Embeds to header.php ↓', 'responsive-II' ),  
  271. 'type' => 'textarea',  
  272. 'description' => __( 'Enter your custom header script.', 'responsive-II' ),  
  273. 'default' => '',  
  274. 'validate' => 'js' 
  275. ),  
  276. array( 
  277. 'heading' => __( 'Embeds to footer.php ↓', 'responsive-II' ),  
  278. 'type' => 'textarea',  
  279. 'description' => __( 'Enter your custom footer script.', 'responsive-II' ),  
  280. 'default' => '',  
  281. 'validate' => 'js' 
  282.  
  283. ); 
  284.  
  285. $options = apply_filters( 'responsive_II_option_options_filter', $options ); 
  286.  
  287. $theme_options = new Responsive_Options( $options ); 
  288.  
  289. return $theme_options;