Guest User

Untitled

a guest
Jan 6th, 2014
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.56 KB | None | 0 0
  1. <?php
  2.  
  3. function optionsframework_option_name() {
  4.  
  5. // This gets the theme name from the stylesheet (lowercase and without spaces)
  6. $themename = wp_get_theme('style.css');
  7. $themename = $themename['Name'];
  8. $themename = preg_replace("/\W/", "", strtolower($themename) );
  9.  
  10. $optionsframework_settings = get_option('optionsframework');
  11. $optionsframework_settings['id'] = $themename;
  12. update_option('optionsframework', $optionsframework_settings);
  13.  
  14. // echo $themename;
  15. }
  16.  
  17. /**
  18. * Defines an array of options that will be used to generate the settings page and be saved in the database.
  19. * When creating the "id" fields, make sure to use all lowercase and no spaces.
  20. *
  21. */
  22.  
  23. function optionsframework_options() {
  24.  
  25. // Radio button array for columns
  26. $columns_array = array("one" => __("One Column Layout", 'organicthemes'),"two" => __("Two Column Layout", 'organicthemes'),"three" => __("Three Column Layout", 'organicthemes'),"fourth" => __("Fourth Column Layout", 'organicthemes'));
  27.  
  28. // Test data
  29. $test_array = array("one" => __("One", 'organicthemes'),"two" => __("Two", 'organicthemes'),"three" => __("Three", 'organicthemes'),"four" => __("Four", 'organicthemes'),"five" => __("Five", 'organicthemes'));
  30.  
  31. // Multicheck Array
  32. $multicheck_array = array("one" => __("French Toast", 'organicthemes'), "two" => __("Pancake", 'organicthemes'), "three" => __("Omelette", 'organicthemes'), "four" => __("Crepe", 'organicthemes'), "five" => __("Waffle", 'organicthemes'));
  33.  
  34. // Multicheck Defaults
  35. $multicheck_defaults = array("one" => "true","five" => "true");
  36.  
  37. // Background Defaults
  38. $background_defaults = array('color' => '', 'image' => '', 'repeat' => 'repeat','position' => 'top center','attachment'=>'scroll');
  39.  
  40. // Slider Transition Array
  41. $transition_array = array("1000" => __("1 Second", 'organicthemes'), "2000" => __("2 Seconds", 'organicthemes'), "4000" => __("4 Seconds", 'organicthemes'), "6000" => __("6 Seconds", 'organicthemes'), "8000" => __("8 Seconds", 'organicthemes'), "10000" => __("10 Seconds", 'organicthemes'), "12000" => __("12 Seconds", 'organicthemes'), "14000" => __("14 Seconds", 'organicthemes'), "16000" => __("16 Seconds", 'organicthemes'), "18000" => __("18 Seconds", 'organicthemes'), "20000" => __("20 Seconds", 'organicthemes'), "30000" => __("30 Seconds", 'organicthemes'), "60000" => __("1 Minute", 'organicthemes'), "999999999" => __("Hold Frame", 'organicthemes'));
  42.  
  43. // Slider Transition Style Array
  44. $transition_style = array("fade" => __("Fade", 'organicthemes'), "slide" => __("Slide", 'organicthemes'));
  45.  
  46. // Yes or No Array
  47. $yesno_array = array("true" => __("Yes", 'organicthemes'), "false" => __("No", 'organicthemes'));
  48.  
  49.  
  50. // Pull all the categories into an array
  51. $options_categories = array();
  52. $options_categories_obj = get_categories();
  53. foreach ($options_categories_obj as $category) {
  54. $options_categories[$category->cat_ID] = $category->cat_name;
  55. }
  56.  
  57. // Add all categories option
  58. $options_categories[0] = __("All Categories", 'organicthemes');
  59.  
  60. // Pull all the pages into an array
  61. $options_pages = array();
  62. $options_pages_obj = get_pages('sort_column=post_parent,menu_order');
  63. $options_pages['false'] = __("Select a page:", 'organicthemes');
  64. foreach ($options_pages_obj as $page) {
  65. $options_pages[$page->ID] = $page->post_title;
  66. }
  67.  
  68. // If using image radio buttons, define a directory path
  69. $imagepath = get_stylesheet_directory_uri() . '/images/';
  70.  
  71. $options = array();
  72.  
  73. $options[] = array( "name" => __("Slider", 'organicthemes'),
  74. "type" => "heading");
  75.  
  76. $options[] = array( "name" => __("Featured Slideshow Category", 'organicthemes'),
  77. "desc" => __("Choose the category you wish to display in the homepage slideshow.", 'organicthemes'),
  78. "id" => "category_slideshow_home",
  79. "std" => __("Select a category:", 'organicthemes'),
  80. "type" => "select",
  81. "options" => $options_categories);
  82.  
  83. $options[] = array( "name" => __("Featured Slideshow Posts To Display", 'organicthemes'),
  84. "desc" => __("Enter the number of posts you would like to display on the homepage slideshow.", 'organicthemes'),
  85. "id" => "postnumber_slideshow_home",
  86. "std" => "20",
  87. "type" => "text");
  88.  
  89. $options[] = array( "name" => __("Slideshow Transition Interval", 'organicthemes'),
  90. "desc" => __("Choose the transition time for the slideshow. This is the time the frame is held before transitioning to the next slide.", 'organicthemes'),
  91. "id" => "transition_interval",
  92. "std" => "10000",
  93. "type" => "select",
  94. "options" => $transition_array);
  95.  
  96. $options[] = array( "name" => __("Slideshow Transition Style", 'organicthemes'),
  97. "desc" => __("Choose the transition style for the slideshow.", 'organicthemes'),
  98. "id" => "transition_style",
  99. "std" => "slide",
  100. "type" => "select",
  101. "options" => $transition_style);
  102.  
  103. $options[] = array( "name" => __("Homepage", 'organicthemes'),
  104. "type" => "heading");
  105.  
  106. $options[] = array( "name" => __("Featured Posts Category", 'organicthemes'),
  107. "desc" => __("Choose the category you wish to display in 3 column featured post section.", 'organicthemes'),
  108. "id" => "category_features",
  109. "std" => __("Select a category:", 'organicthemes'),
  110. "type" => "select",
  111. "options" => $options_categories);
  112.  
  113. $options[] = array( "name" => __("Featured Posts Displayed", 'organicthemes'),
  114. "desc" => __("Enter the number of posts you would like to display in the 3 column featured post section.", 'organicthemes'),
  115. "id" => "postnumber_features",
  116. "std" => "3",
  117. "type" => "text");
  118.  
  119. $options[] = array( "name" => __("News Posts Category", 'organicthemes'),
  120. "desc" => __("Choose the category you wish to display in the news section.", 'organicthemes'),
  121. "id" => "category_news",
  122. "std" => __("Select a category:", 'organicthemes'),
  123. "type" => "select",
  124. "options" => $options_categories);
  125.  
  126. $options[] = array( "name" => __("News Posts Displayed", 'organicthemes'),
  127. "desc" => __("Enter the number of posts you would like to display in the news section.", 'organicthemes'),
  128. "id" => "postnumber_news",
  129. "std" => "3",
  130. "type" => "text");
  131.  
  132. $options[] = array( "name" => __("Display News Category Title?", 'organicthemes'),
  133. "desc" => __("Selecting this option will display the category title above the news section.", 'organicthemes'),
  134. "id" => "display_news_cat",
  135. "std" => "1",
  136. "type" => "checkbox");
  137.  
  138. $options[] = array( "name" => __("Display Homepage Middle Section?", 'organicthemes'),
  139. "desc" => __("Selecting this option will display the 3 column featured posts in the middle section of the homepage.", 'organicthemes'),
  140. "id" => "display_home_mid",
  141. "std" => "1",
  142. "type" => "checkbox");
  143.  
  144. $options[] = array( "name" => __("Display Homepage Bottom Section?", 'organicthemes'),
  145. "desc" => __("Selecting this option will display the full width featured posts in the bottom section of the homepage.", 'organicthemes'),
  146. "id" => "display_home_bottom",
  147. "std" => "1",
  148. "type" => "checkbox");
  149.  
  150. $options[] = array( "name" => __("Layout", 'organicthemes'),
  151. "type" => "heading");
  152.  
  153. $options[] = array( "name" => __("Display Post Featured Image or Video?", 'organicthemes'),
  154. "desc" => __("Selecting this option will display the featured image or video in an individual post.", 'organicthemes'),
  155. "id" => "display_feature_post",
  156. "std" => "1",
  157. "type" => "checkbox");
  158.  
  159. $options[] = array( "name" => __("Display Slideshow Page Content?", 'organicthemes'),
  160. "desc" => __("Selecting this option will display the page title and body content on the slideshow page template.", 'organicthemes'),
  161. "id" => "display_slideshow_info",
  162. "std" => "1",
  163. "type" => "checkbox");
  164.  
  165. $options[] = array( "name" => __("Enable CSS3 Full Width Background Image?", 'organicthemes'),
  166. "desc" => __("Enables an applied background image to stretch to the full width of the browser. Do not use with a tiled background.", 'organicthemes'),
  167. "id" => "background_stretch",
  168. "std" => "0",
  169. "type" => "checkbox");
  170.  
  171. $options[] = array( "name" => __("Enable Responsive Layout?", 'organicthemes'),
  172. "desc" => __("Enables the responsive site layout for the iPhone, iPad and mobile devices.", 'organicthemes'),
  173. "id" => "enable_responsive",
  174. "std" => "1",
  175. "type" => "checkbox");
  176.  
  177. $options[] = array( "name" => __("Blog", 'organicthemes'),
  178. "type" => "heading");
  179.  
  180. $options[] = array( "name" => __("Blog Template Category", 'organicthemes'),
  181. "desc" => __("Choose the category you wish to display on the blog page template.", 'organicthemes'),
  182. "id" => "category_blog",
  183. "std" => __("Select a category:", 'organicthemes'),
  184. "type" => "select",
  185. "options" => $options_categories);
  186.  
  187. $options[] = array( "name" => __("Blog Posts To Display", 'organicthemes'),
  188. "desc" => __("Enter the number of posts you would like to display on the blog page template.", 'organicthemes'),
  189. "id" => "postnumber_blog",
  190. "std" => "5",
  191. "type" => "text");
  192.  
  193. $options[] = array( "name" => __("Portfolio", 'organicthemes'),
  194. "type" => "heading");
  195.  
  196. $options[] = array( "name" => __("Portfolio Columns", 'organicthemes'),
  197. "id" => "portfolio_columns",
  198. "std" => "three",
  199. "type" => "radio",
  200. "options" => $columns_array);
  201.  
  202. $options[] = array( "name" => __("Portfolio Category", 'organicthemes'),
  203. "desc" => __("Choose the category you wish to display on the portfolio page template. Sub-categories will be displayed as portfolio filters.", 'organicthemes'),
  204. "id" => "category_portfolio",
  205. "std" => __("Select a category:", 'organicthemes'),
  206. "type" => "select",
  207. "options" => $options_categories);
  208.  
  209. $options[] = array( "name" => __("Display Portfolio Info?", 'organicthemes'),
  210. "desc" => __("Selecting this option will display the post title and excerpt for portfolio posts on the portfolio page template.", 'organicthemes'),
  211. "id" => "display_portfolio_info",
  212. "std" => "1",
  213. "type" => "checkbox");
  214.  
  215. $options[] = array( "name" => __("Social", 'organicthemes'),
  216. "type" => "heading");
  217.  
  218. $options[] = array( "name" => __("Blog Social Links", 'organicthemes'),
  219. "desc" => __("Selecting this option will display the social links on the blog page template. Disabling this feature may increase the blog load time.", 'organicthemes'),
  220. "id" => "display_social_blog",
  221. "std" => "1",
  222. "type" => "checkbox");
  223.  
  224. $options[] = array( "name" => __("Post Social Links", 'organicthemes'),
  225. "desc" => __("Selecting this option will display the social links on the individual posts.", 'organicthemes'),
  226. "id" => "display_social_post",
  227. "std" => "1",
  228. "type" => "checkbox");
  229.  
  230. $options[] = array( "name" => __("Twitter Name", 'organicthemes'),
  231. "desc" => __("Please enter your Twitter username.", 'organicthemes'),
  232. "id" => "twitter_user",
  233. "std" => __("organicthemes", 'organicthemes'),
  234. "type" => "text");
  235.  
  236. $options[] = array( "name" => __("Facebook Page Link", 'organicthemes'),
  237. "desc" => __("Enter a link to your Facebook page or profile.", 'organicthemes'),
  238. "id" => "facebook_link",
  239. "std" => "",
  240. "type" => "text");
  241.  
  242. $options[] = array( "name" => __("Twitter Account Link", 'organicthemes'),
  243. "desc" => __("Enter a link to your Twitter account.", 'organicthemes'),
  244. "id" => "twitter_link",
  245. "std" => "",
  246. "type" => "text");
  247.  
  248. $options[] = array( "name" => __("LinkedIn Account Link", 'organicthemes'),
  249. "desc" => __("Enter a link to your LinkedIn page.", 'organicthemes'),
  250. "id" => "linkedin_link",
  251. "std" => "",
  252. "type" => "text");
  253.  
  254. $options[] = array( "name" => __("Dribbble Page Link", 'organicthemes'),
  255. "desc" => __("Enter a link to your Dribbble page.", 'organicthemes'),
  256. "id" => "dribbble_link",
  257. "std" => "",
  258. "type" => "text");
  259.  
  260. $options[] = array( "name" => __("Skype Account Link", 'organicthemes'),
  261. "desc" => __("Enter a link to your Skype account. (e.g. skype://MySkypeName)", 'organicthemes'),
  262. "id" => "skype_link",
  263. "std" => "",
  264. "type" => "text");
  265.  
  266. $options[] = array( "name" => __("Google Plus Profile Link", 'organicthemes'),
  267. "desc" => __("Enter a link to your Google Plus page.", 'organicthemes'),
  268. "id" => "plus_link",
  269. "std" => "",
  270. "type" => "text");
  271.  
  272. $options[] = array( "name" => __("Pinterest Profile Link", 'organicthemes'),
  273. "desc" => __("Enter a link to your Pinterest page.", 'organicthemes'),
  274. "id" => "pinterest_link",
  275. "std" => "",
  276. "type" => "text");
  277.  
  278. $options[] = array( "name" => __("Github Link", 'organicthemes'),
  279. "desc" => __("Enter a link to your Github page.", 'organicthemes'),
  280. "id" => "github_link",
  281. "std" => "",
  282. "type" => "text");
  283.  
  284. $options[] = array( "name" => __("Instagram Link", 'organicthemes'),
  285. "desc" => __("Enter a link to your Instagram page.", 'organicthemes'),
  286. "id" => "instagram_link",
  287. "std" => "",
  288. "type" => "text");
  289.  
  290. $options[] = array( "name" => __("YouTube Link", 'organicthemes'),
  291. "desc" => __("Enter a link to your YouTube page.", 'organicthemes'),
  292. "id" => "youtube_link",
  293. "std" => "",
  294. "type" => "text");
  295.  
  296. $options[] = array( "name" => __("Email Address", 'organicthemes'),
  297. "desc" => __("Enter your email address.", 'organicthemes'),
  298. "id" => "email_link",
  299. "std" => "",
  300. "type" => "text");
  301.  
  302. $options[] = array( "name" => __("Colors", 'organicthemes'),
  303. "type" => "heading");
  304.  
  305. $options[] = array( "name" => __("Link Color", 'organicthemes'),
  306. "desc" => __("Select the color you wish to use for the link colors.", 'organicthemes'),
  307. "id" => "link_color",
  308. "std" => "#ff6666",
  309. "type" => "color");
  310.  
  311. $options[] = array( "name" => __("Link Hover Color", 'organicthemes'),
  312. "desc" => __("Select the color you wish to use for the text link hover colors.", 'organicthemes'),
  313. "id" => "link_hover_color",
  314. "std" => "#ff3333",
  315. "type" => "color");
  316.  
  317. $options[] = array( "name" => __("Heading Link Color", 'organicthemes'),
  318. "desc" => __("Select the color you wish to use for the heading link colors.", 'organicthemes'),
  319. "id" => "heading_link_color",
  320. "std" => "#333333",
  321. "type" => "color");
  322.  
  323. $options[] = array( "name" => __("Heading Link Hover Color", 'organicthemes'),
  324. "desc" => __("Select the color you wish to use for the heading link hover colors.", 'organicthemes'),
  325. "id" => "heading_link_hover_color",
  326. "std" => "#ff3333",
  327. "type" => "color");
  328.  
  329. $options[] = array( "name" => __("Highlight Color", 'organicthemes'),
  330. "desc" => __("Select the color you wish to use for the highlight color. This refers primarily to button colors.", 'organicthemes'),
  331. "id" => "highlight_color",
  332. "std" => "#ff3333",
  333. "type" => "color");
  334.  
  335. return $options;
  336. }
Advertisement
Add Comment
Please, Sign In to add comment