optionsframework_options

Defines an array of options that will be used to generate the settings page and be saved in the database.

Description

optionsframework_options(); 

When creating the id fields, make sure to use all lowercase and no spaces.


Usage

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

Defined (1)

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

/options.php  
  1. function optionsframework_options() { 
  2. //Stylesheet Reader 
  3. $alt_stylesheets = array("black" => 
  4. "black", "brown" => "brown", "blue" => "blue", "green" => "green", "pink" => "pink", "purple" => "purple", "red" => "red", "yellow" => "yellow"); 
  5.  
  6. // Test data 
  7. $test_array = array("one" => "One", "two" => "Two", "three" => "Three", "four" => "Four", "five" => "Five"); 
  8.  
  9. // Multicheck Array 
  10. $multicheck_array = array("one" => "French Toast", "two" => "Pancake", "three" => "Omelette", "four" => "Crepe", "five" => "Waffle"); 
  11.  
  12. // Multicheck Defaults 
  13. $multicheck_defaults = array("one" => "1", "five" => "1"); 
  14.  
  15. // Background Defaults 
  16.  
  17. $background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat', 'position' => 'top center', 'attachment'=>'scroll'); 
  18.  
  19.  
  20. // Pull all the categories into an array 
  21. $options_categories = array();  
  22. $options_categories_obj = get_categories(); 
  23. foreach ($options_categories_obj as $category) { 
  24. $options_categories[$category->cat_ID] = $category->cat_name; 
  25.  
  26. // Pull all the pages into an array 
  27. $options_pages = array();  
  28. $options_pages_obj = get_pages('sort_column=post_parent, menu_order'); 
  29. $options_pages[''] = 'Select a page:'; 
  30. foreach ($options_pages_obj as $page) { 
  31. $options_pages[$page->ID] = $page->post_title; 
  32.  
  33. // If using image radio buttons, define a directory path 
  34. $imagepath = get_bloginfo('stylesheet_directory') . '/images/'; 
  35.  
  36. $options = array(); 
  37.  
  38. $options[] = array( "name" => "General Settings",  
  39. "type" => "heading"); 
  40.  
  41. $options[] = array( "name" => "Custom Logo",  
  42. "desc" => "Choose your own logo. Optimal Size: 215px Wide by 55px Height",  
  43. "id" => "colorway_logo",  
  44. "type" => "upload"); 
  45.  
  46. $options[] = array( "name" => "Custom Favicon",  
  47. "desc" => "Specify a 16px x 16px image that will represent your website's favicon.",  
  48. "id" => "colorway_favicon",  
  49. "type" => "upload"); 
  50.  
  51. $options[] = array( "name" => "Tracking Code",  
  52. "desc" => "Paste your Google Analytics (or other) tracking code here.",  
  53. "id" => "colorway_analytics",  
  54. "std" => "",  
  55. "type" => "textarea");  
  56. $options[] = array( "name" => "Body Background Image",  
  57. "desc" => "Select image to change your website background",  
  58. "id" => "inkthemes_bodybg",  
  59. "std" => "",  
  60. "type" => "upload");  
  61. //****=============================================================================****// 
  62. //****-----------This code is used for creating slider settings--------------------****//  
  63. //****=============================================================================****//  
  64. $options[] = array( "name" => "Slider Settings",  
  65. "type" => "heading"); 
  66.  
  67. $options[] = array( "name" => "Slide1 Image",  
  68. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  69. "id" => "colorway_slideimage1",  
  70. "type" => "upload"); 
  71. $options[] = array( "name" => "Slide1 Heading",  
  72. "desc" => "Enter the Heading for Slide1",  
  73. "id" => "colorway_slideheading1",  
  74. "std" => "",  
  75. "type" => "text"); 
  76.  
  77. $options[] = array( "name" => "Slide1 Heading Link",  
  78. "desc" => "Enter the Link URL in Heading for Slide1",  
  79. "id" => "colorway_slidelink1",  
  80. "std" => "",  
  81. "type" => "text"); 
  82. $options[] = array( "name" => "Slide1 Description",  
  83. "desc" => "Description for Slide1",  
  84. "id" => "colorway_slidedescription1",  
  85. "std" => "",  
  86. "type" => "textarea"); 
  87. $options[] = array( "name" => "Slide2 Image",  
  88. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  89. "id" => "colorway_slideimage2",  
  90. "type" => "upload"); 
  91.  
  92. $options[] = array( "name" => "Slide2 Heading",  
  93. "desc" => "Enter the Heading for Slide2",  
  94. "id" => "colorway_slideheading2",  
  95. "std" => "",  
  96. "type" => "text"); 
  97.  
  98. $options[] = array( "name" => "Slide2 Heading Link",  
  99. "desc" => "Enter the Link URL in Heading for Slide2",  
  100. "id" => "colorway_slidelink2",  
  101. "std" => "",  
  102. "type" => "text"); 
  103. $options[] = array( "name" => "Slide2 Description",  
  104. "desc" => "Description for Slide2",  
  105. "id" => "colorway_slidedescription2",  
  106. "std" => "",  
  107. "type" => "textarea"); 
  108.  
  109. $options[] = array( "name" => "Slide3 Image",  
  110. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  111. "id" => "colorway_slideimage3",  
  112. "type" => "upload"); 
  113.  
  114. $options[] = array( "name" => "Slide3 Heading",  
  115. "desc" => "Enter the Heading for Slide3",  
  116. "id" => "colorway_slideheading3",  
  117. "std" => "",  
  118. "type" => "text"); 
  119.  
  120. $options[] = array( "name" => "Slide3 Heading Link",  
  121. "desc" => "Enter the Link URL in Heading for Slide3",  
  122. "id" => "colorway_slidelink3",  
  123. "std" => "",  
  124. "type" => "text"); 
  125. $options[] = array( "name" => "Slide3 Description",  
  126. "desc" => "Description for Slide3",  
  127. "id" => "colorway_slidedescription3",  
  128. "std" => "",  
  129. "type" => "textarea"); 
  130. $options[] = array( "name" => "Slide4 Image",  
  131. "desc" => "Choose Image for your Slider. Optimal Size: 896px x 350px",  
  132. "id" => "colorway_slideimage4",  
  133. "type" => "upload"); 
  134.  
  135. $options[] = array( "name" => "Slide4 Heading",  
  136. "desc" => "Enter the Heading for Slide4",  
  137. "id" => "colorway_slideheading4",  
  138. "std" => "",  
  139. "type" => "text"); 
  140.  
  141. $options[] = array( "name" => "Slide4 Heading Link",  
  142. "desc" => "Enter the Link URL in Heading for Slide4",  
  143. "id" => "colorway_slidelink4",  
  144. "std" => "",  
  145. "type" => "text"); 
  146. $options[] = array( "name" => "Slide4 Description",  
  147. "desc" => "Description for Slide4",  
  148. "id" => "colorway_slidedescription4",  
  149. "std" => "",  
  150. "type" => "textarea"); 
  151. //****=============================================================================****// 
  152. //****-----------This code is used for creating home page feature content----------****//  
  153. //****=============================================================================****//  
  154. $options[] = array( "name" => "Home Page Settings",  
  155. "type" => "heading");  
  156.  
  157. $options[] = array( "name" => "Home Page Intro",  
  158. "desc" => "Enter your heading text for home page",  
  159. "id" => "inkthemes_mainheading",  
  160. "std" => "",  
  161. "type" => "text");  
  162. //***Code for first column***// 
  163. $options[] = array( "name" => "First Feature Image",  
  164. "desc" => "Choose image for your feature column first. Optimal size 198px x 115px",  
  165. "id" => "inkthemes_fimg1",  
  166. "std" => "",  
  167. "type" => "upload"); 
  168.  
  169. $options[] = array( "name" => "First Feature Heading",  
  170. "desc" => "Enter your heading line for first column",  
  171. "id" => "inkthemes_headline1",  
  172. "std" => "",  
  173. "type" => "text");  
  174.  
  175. $options[] = array( "name" => "First Feature Link",  
  176. "desc" => "Enter your link for feature column first",  
  177. "id" => "inkthemes_link1",  
  178. "std" => "",  
  179. "type" => "text");  
  180.  
  181. $options[] = array( "name" => "First Feature Content",  
  182. "desc" => "Enter your feature content for column first",  
  183. "id" => "inkthemes_feature1",  
  184. "std" => "",  
  185. "type" => "textarea"); 
  186.  
  187. //***Code for second column***//  
  188. $options[] = array( "name" => "Second Feature Image",  
  189. "desc" => "Choose image for your feature column second. Optimal size 198px x 115px",  
  190. "id" => "inkthemes_fimg2",  
  191. "std" => "",  
  192. "type" => "upload"); 
  193.  
  194. $options[] = array( "name" => "Second Feature Heading",  
  195. "desc" => "Enter your heading line for second column",  
  196. "id" => "inkthemes_headline2",  
  197. "std" => "",  
  198. "type" => "text"); 
  199.  
  200. $options[] = array( "name" => "Second Feature Link",  
  201. "desc" => "Enter your link for feature column second",  
  202. "id" => "inkthemes_link2",  
  203. "std" => "",  
  204. "type" => "text");  
  205.  
  206.  
  207. $options[] = array( "name" => "Second Feature Content",  
  208. "desc" => "Enter your feature content for column second",  
  209. "id" => "inkthemes_feature2",  
  210. "std" => "",  
  211. "type" => "textarea"); 
  212.  
  213.  
  214. //***Code for third column***//  
  215. $options[] = array( "name" => "Third Feature Image",  
  216. "desc" => "Choose image for your feature column thrid. Optimal size 198px x 115px",  
  217. "id" => "inkthemes_fimg3",  
  218. "std" => "",  
  219. "type" => "upload"); 
  220.  
  221. $options[] = array( "name" => "Third Feature Heading",  
  222. "desc" => "Enter your heading line for third column",  
  223. "id" => "inkthemes_headline3",  
  224. "std" => "",  
  225. "type" => "text"); 
  226.  
  227. $options[] = array( "name" => "Third Feature Link",  
  228. "desc" => "Enter your link for feature column third",  
  229. "id" => "inkthemes_link3",  
  230. "std" => "",  
  231. "type" => "text");  
  232.  
  233. $options[] = array( "name" => "Third Feature Content",  
  234. "desc" => "Enter your feature content for third column",  
  235. "id" => "inkthemes_feature3",  
  236. "std" => "",  
  237. "type" => "textarea"); 
  238.  
  239. //***Code for fourth column***//  
  240. $options[] = array( "name" => "Fourth Feature Image",  
  241. "desc" => "Choose image for your feature column fourth. Optimal size 198px x 115px",  
  242. "id" => "inkthemes_fimg4",  
  243. "std" => "",  
  244. "type" => "upload"); 
  245.  
  246. $options[] = array( "name" => "Fourth Feature Heading",  
  247. "desc" => "Enter your heading line for fourth column",  
  248. "id" => "inkthemes_headline4",  
  249. "std" => "",  
  250. "type" => "text");  
  251.  
  252. $options[] = array( "name" => "Fourth Feature link",  
  253. "desc" => "Enter your link for feature column fourth",  
  254. "id" => "inkthemes_link4",  
  255. "std" => "",  
  256. "type" => "text");  
  257.  
  258. $options[] = array( "name" => "Fourth Feature Content",  
  259. "desc" => "Enter your feature content for fourth column",  
  260. "id" => "inkthemes_feature4",  
  261. "std" => "",  
  262. "type" => "textarea");  
  263.  
  264. $options[] = array( "name" => "Home Page Testimonial",  
  265. "desc" => "Enter your text for homepage testimonial in short paragraph.",  
  266. "id" => "inkthemes_testimonial",  
  267. "std" => "",  
  268. "type" => "textarea");  
  269.  
  270. //****=============================================================================****// 
  271. //****-----------This code is used for creating color styleshteet options----------****//  
  272. //****=============================================================================****//  
  273. $options[] = array( "name" => "Styling Options",  
  274. "type" => "heading");  
  275. $options[] = array( "name" => "Theme Stylesheet",  
  276. "desc" => "Select your themes alternative color scheme.",  
  277. "id" => "colorway_altstylesheet",  
  278. "std" => "green",  
  279. "type" => "select",  
  280. "options" => $alt_stylesheets);  
  281.  
  282. $options[] = array( "name" => "Custom CSS",  
  283. "desc" => "Quickly add some CSS to your theme by adding it to this block.",  
  284. "id" => "colorway_customcss",  
  285. "std" => "",  
  286. "type" => "textarea");  
  287.  
  288. $options[] = array( "name" => "Footer Settings",  
  289. "type" => "heading"); 
  290. $options[] = array( "name" => "Facebook URL",  
  291. "desc" => "Enter your Facebook URL if you have one",  
  292. "id" => "colorway_facebook",  
  293. "std" => "",  
  294. "type" => "text");  
  295. $options[] = array( "name" => "Twitter URL",  
  296. "desc" => "Enter your Twitter URL if you have one",  
  297. "id" => "colorway_twitter",  
  298. "std" => "",  
  299. "type" => "text");  
  300.  
  301. $options[] = array( "name" => "RSS Feed URL",  
  302. "desc" => "Enter your RSS Feed URL if you have one",  
  303. "id" => "colorway_rss",  
  304. "std" => "",  
  305. "type" => "text");  
  306. $options[] = array( "name" => "Footer Text",  
  307. "desc" => "Enter text you want to be displayed on Footer",  
  308. "id" => "colorway_footertext",  
  309. "std" => "",  
  310. "type" => "text"); 
  311.  
  312. return $options;