Advertisement
Guest User

Untitled

a guest
Jun 24th, 2014
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.91 KB | None | 0 0
  1. <?php
  2. /**
  3. ReduxFramework Sample Config File
  4. For full documentation, please visit: https://github.com/ReduxFramework/ReduxFramework/wiki
  5. * */
  6.  
  7. if (!class_exists("Themewich_Options_Config")) {
  8.  
  9. class Themewich_Options_Config {
  10.  
  11. public $args = array();
  12. public $sections = array();
  13. public $theme;
  14. public $ReduxFramework;
  15.  
  16. public function __construct() {
  17.  
  18. if ( !class_exists("ReduxFramework" ) ) {
  19. return;
  20. }
  21.  
  22. // This is needed. Bah WordPress bugs. ;)
  23. if ( true == Redux_Helpers::isTheme(__FILE__) ) {
  24. $this->initSettings();
  25. } else {
  26. add_action('plugins_loaded', array($this, 'initSettings'), 10);
  27. }
  28. }
  29.  
  30. public function initSettings() {
  31.  
  32. // Just for demo purposes. Not needed per say.
  33. $this->theme = wp_get_theme();
  34.  
  35. // Set the default arguments
  36. $this->setArguments();
  37.  
  38. // Set a few help tabs so you can see how it's done
  39. //$this->setHelpTabs();
  40.  
  41. // Create the sections and fields
  42. $this->setSections();
  43.  
  44. if (!isset($this->args['opt_name'])) { // No errors please
  45. return;
  46. }
  47.  
  48. // If Redux is running as a plugin, this will remove the demo notice and links
  49. add_action( 'redux/loaded', array( $this, 'remove_demo' ) );
  50.  
  51. // Function to test the compiler hook and demo CSS output.
  52. //add_filter('redux/options/'.$this->args['opt_name'].'/compiler', array( $this, 'compiler_action' ), 10, 2);
  53. // Above 10 is a priority, but 2 in necessary to include the dynamically generated CSS to be sent to the function.
  54. // Change the arguments after they've been declared, but before the panel is created
  55. //add_filter('redux/options/'.$this->args['opt_name'].'/args', array( $this, 'change_arguments' ) );
  56. // Change the default value of a field after it's been set, but before it's been useds
  57. //add_filter('redux/options/'.$this->args['opt_name'].'/defaults', array( $this,'change_defaults' ) );
  58. // Dynamically add a section. Can be also used to modify sections/fields
  59. // add_filter('redux/options/' . $this->args['opt_name'] . '/sections', array($this, 'dynamic_section'));
  60.  
  61. $this->ReduxFramework = new ReduxFramework($this->sections, $this->args);
  62. }
  63.  
  64. /**
  65.  
  66. This is a test function that will let you see when the compiler hook occurs.
  67. It only runs if a field set with compiler=>true is changed.
  68.  
  69. * */
  70. function compiler_action($options, $css) {
  71. //echo "<h1>The compiler hook has run!";
  72. //print_r($options); //Option values
  73. //print_r($css); // Compiler selector CSS values compiler => array( CSS SELECTORS )
  74.  
  75. /*
  76. // Demo of how to use the dynamic CSS and write your own static CSS file
  77. $filename = dirname(__FILE__) . '/style' . '.css';
  78. global $wp_filesystem;
  79. if( empty( $wp_filesystem ) ) {
  80. require_once( ABSPATH .'/wp-admin/includes/file.php' );
  81. WP_Filesystem();
  82. }
  83.  
  84. if( $wp_filesystem ) {
  85. $wp_filesystem->put_contents(
  86. $filename,
  87. $css,
  88. FS_CHMOD_FILE // predefined mode settings for WP files
  89. );
  90. }
  91. */
  92. }
  93.  
  94. /**
  95.  
  96. Custom function for filtering the sections array. Good for child themes to override or add to the sections.
  97. Simply include this function in the child themes functions.php file.
  98.  
  99. NOTE: the defined constants for URLs, and directories will NOT be available at this point in a child theme,
  100. so you must use get_template_directory_uri() if you want to use any of the built in icons
  101.  
  102. * */
  103. function dynamic_section($sections) {
  104. //$sections = array();
  105. $sections[] = array(
  106. 'title' => __('Section via hook', 'themewich'),
  107. 'desc' => __('<p class="description">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>', 'themewich'),
  108. 'icon' => 'el-icon-paper-clip',
  109. // Leave this as a blank section, no options just some intro text set above.
  110. 'fields' => array()
  111. );
  112.  
  113. return $sections;
  114. }
  115.  
  116. /**
  117.  
  118. Filter hook for filtering the args. Good for child themes to override or add to the args array. Can also be used in other functions.
  119.  
  120. * */
  121. function change_arguments($args) {
  122. //$args['dev_mode'] = true;
  123.  
  124. return $args;
  125. }
  126.  
  127. /**
  128.  
  129. Filter hook for filtering the default value of any given field. Very useful in development mode.
  130.  
  131. * */
  132. function change_defaults($defaults) {
  133. $defaults['str_replace'] = "Testing filter hook!";
  134.  
  135. return $defaults;
  136. }
  137.  
  138. // Remove the demo link and the notice of integrated demo from the redux-framework plugin
  139. function remove_demo() {
  140.  
  141. // Used to hide the demo mode link from the plugin page. Only used when Redux is a plugin.
  142. if (class_exists('ReduxFrameworkPlugin')) {
  143. remove_filter('plugin_row_meta', array(ReduxFrameworkPlugin::instance(), 'plugin_metalinks'), null, 2);
  144.  
  145. // Used to hide the activation notice informing users of the demo panel. Only used when Redux is a plugin.
  146. remove_action('admin_notices', array(ReduxFrameworkPlugin::instance(), 'admin_notices'));
  147.  
  148. }
  149. }
  150.  
  151. public function setSections() {
  152.  
  153. /**
  154. Used within different fields. Simply examples. Search for ACTUAL DECLARATION for field examples
  155. * */
  156. // Background Patterns Reader
  157. $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/';
  158. $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/';
  159. $sample_patterns = array();
  160.  
  161. if (is_dir($sample_patterns_path)) :
  162.  
  163. if ($sample_patterns_dir = opendir($sample_patterns_path)) :
  164. $sample_patterns = array();
  165.  
  166. while (( $sample_patterns_file = readdir($sample_patterns_dir) ) !== false) {
  167.  
  168. if (stristr($sample_patterns_file, '.png') !== false || stristr($sample_patterns_file, '.jpg') !== false) {
  169. $name = explode(".", $sample_patterns_file);
  170. $name = str_replace('.' . end($name), '', $sample_patterns_file);
  171. $sample_patterns[] = array('alt' => $name, 'img' => $sample_patterns_url . $sample_patterns_file);
  172. }
  173. }
  174. endif;
  175. endif;
  176.  
  177. ob_start();
  178.  
  179. $ct = wp_get_theme();
  180. $this->theme = $ct;
  181. $item_name = $this->theme->get('Name');
  182. $tags = $this->theme->Tags;
  183. $screenshot = $this->theme->get_screenshot();
  184. $class = $screenshot ? 'has-screenshot' : '';
  185.  
  186. $customize_title = sprintf(__('Customize &#8220;%s&#8221;', 'themewich'), $this->theme->display('Name'));
  187. ?>
  188. <div id="current-theme" class="<?php echo esc_attr($class); ?>">
  189. <?php if ($screenshot) : ?>
  190. <?php if (current_user_can('edit_theme_options')) : ?>
  191. <a href="<?php echo wp_customize_url(); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr($customize_title); ?>">
  192. <img src="<?php echo esc_url($screenshot); ?>" alt="<?php esc_attr_e('Current theme preview'); ?>" />
  193. </a>
  194. <?php endif; ?>
  195. <img class="hide-if-customize" src="<?php echo esc_url($screenshot); ?>" alt="<?php esc_attr_e('Current theme preview'); ?>" />
  196. <?php endif; ?>
  197.  
  198. <h4>
  199. <?php echo $this->theme->display('Name'); ?>
  200. </h4>
  201.  
  202. <div>
  203. <ul class="theme-info">
  204. <li><?php printf(__('Version %s', 'themewich'), $this->theme->display('Version')); ?></li>
  205. </ul>
  206. <?php
  207. if ($this->theme->parent()) {
  208. printf(' <p class="howto">' . __('This <a href="%1$s">child theme</a> requires its parent theme, %2$s.') . '</p>', __('http://codex.wordpress.org/Child_Themes', 'themewich'), $this->theme->parent()->display('Name'));
  209. }
  210. ?>
  211.  
  212. </div>
  213.  
  214. </div>
  215.  
  216. <?php
  217. $item_info = ob_get_contents();
  218.  
  219. ob_end_clean();
  220.  
  221. $sampleHTML = '';
  222. if (file_exists(dirname(__FILE__) . '/info-html.html')) {
  223. /** @global WP_Filesystem_Direct $wp_filesystem */
  224. global $wp_filesystem;
  225. if (empty($wp_filesystem)) {
  226. require_once(ABSPATH . '/wp-admin/includes/file.php');
  227. WP_Filesystem();
  228. }
  229. $sampleHTML = $wp_filesystem->get_contents(dirname(__FILE__) . '/info-html.html');
  230. }
  231.  
  232.  
  233. $this->sections[] = array(
  234. 'icon' => 'el-icon-cogs',
  235. 'icon_class' => 'icon-large',
  236. 'title' => __('General Settings', 'themewich'),
  237. 'fields' => array(
  238.  
  239. /* Custom Logo */
  240. array(
  241. 'id'=>'logo',
  242. 'type' => 'media',
  243. 'url'=> true,
  244. 'title' => __('Logo', 'themewich'),
  245. 'compiler' => 'true',
  246. 'desc'=> __('Recommended size no wider than 300px or (600px for retina)', 'themewich'),
  247. 'subtitle' => __('Upload any logo file.', 'themewich'),
  248. ),
  249.  
  250. array(
  251. 'id'=>'retina-logo',
  252. 'type' => 'switch',
  253. 'title' => __('Retina Logo', 'themewich'),
  254. 'subtitle'=> __('Turning this on will half the size of your logo for HDPI displays.', 'themewich'),
  255. "default" => 0,
  256. ),
  257.  
  258. /* Custom Favicon */
  259. array(
  260. 'id'=>'favicon',
  261. 'type' => 'media',
  262. 'url'=> true,
  263. 'title' => __('Favicon', 'themewich'),
  264. 'compiler' => 'true',
  265. 'desc'=> __('Recommended size is 16px x 16px.', 'themewich'),
  266. 'subtitle' => __('Upload a favicon image.', 'themewich'),
  267. ),
  268.  
  269. array(
  270. 'id'=>'tracking-code',
  271. 'type' => 'textarea',
  272. 'title' => __('Tracking Code', 'themewich'),
  273. 'subtitle' => __('Paste your Google Analytics (or other) tracking code here.', 'themewich'),
  274. //'validate' => 'js',
  275. 'hint' => array(
  276. // 'title' => __('Tracking Code', 'themewich'),
  277. 'content' => __('Be sure you are using the whole tracking code, not just a tracking number', 'themewich'),
  278. )
  279. ),
  280. )
  281. );
  282.  
  283. $this->sections[] = array(
  284. 'icon' => 'el-icon-tasks',
  285. 'icon_class' => 'icon-large',
  286. 'title' => __('Customize', 'themewich'),
  287. 'desc' => __('To customize your theme colors, don\'t forget to check out the', 'themewich') . ' <a href="'.get_admin_url( ).'customize.php">' . __('Theme Customizer', 'themewich') . '</a>.',
  288. 'fields' => array(
  289.  
  290. array(
  291. 'id'=>'header_layout',
  292. 'type' => 'radio',
  293. 'title' => __('Navigation Layout', 'themewich'),
  294. 'subtitle' => __('Choose the layout you want for your header.', 'themewich'),
  295. 'options' => array('regular-nav' => 'Next to Logo', 'altnav' => 'Below Logo'),//Must provide key => value pairs for radio options
  296. 'default' => 'regular-nav'
  297. ),
  298.  
  299. array(
  300. 'id'=>'header_ad',
  301. 'type' => 'textarea',
  302. 'title' => __('Header Ad Area', 'themewich'),
  303. 'subtitle' => __('HTML Allowed', 'themewich'),
  304. 'desc' => __('Enter optional ad code here. You can also add any html content. It will display to the right of the logo.', 'themewich'),
  305. 'required' => array('header_layout','equals','altnav'),
  306. ),
  307.  
  308. array(
  309. 'id'=>'header_spacing',
  310. 'type' => 'spacing',
  311. 'output' => array('.top-nav, .altnav .top-nav-inner'), // An array of CSS selectors to apply this font style to
  312. 'mode'=>'padding', // absolute, padding, margin, defaults to padding
  313. 'right' => false, // Disable the right
  314. 'left' => false, // Disable the left
  315. 'units' => 'px', // You can specify a unit value. Possible: px, em, %
  316. 'title' => __('Header Margin', 'themewich'),
  317. 'subtitle' => __('Choose the spacing want in your header.', 'themewich'),
  318. 'default' => array('padding-top' => '25px','padding-bottom' => '25px',)
  319. ),
  320.  
  321. array(
  322. 'id'=>'sticky-nav',
  323. 'type' => 'switch',
  324. 'title' => __('Sticky Navigation', 'themewich'),
  325. 'subtitle'=> __('Stick the navigation to the top of the screen when scrolled on desktop browsers.', 'themewich'),
  326. "default" => 0,
  327. 1 => 'On',
  328. 0 => 'Off',
  329. ),
  330. array(
  331. 'id'=>'search-text',
  332. 'type' => 'text',
  333. 'title' => __('Search Box Default Text', 'themewich'),
  334. 'subtitle' => __('Enter default text for your search box.', 'themewich'),
  335. 'default' => 'Search...'
  336. ),
  337.  
  338. array(
  339. 'id'=>'custom-css',
  340. 'type' => 'ace_editor',
  341. 'title' => __('Custom CSS', 'themewich'),
  342. 'subtitle' => __('Quickly add some CSS to your theme by adding it to this block.', 'themewich'),
  343. 'mode' => 'css',
  344. 'theme' => 'chrome',
  345. 'default' => ""
  346. ),
  347. array(
  348. 'id'=>'custom-js',
  349. 'type' => 'ace_editor',
  350. 'title' => __('Custom Javascript', 'themewich'),
  351. 'subtitle' => __('Quickly add some custom javascript to your theme by adding it to this block.', 'themewich'),
  352. 'mode' => 'javascript',
  353. 'theme' => 'chrome',
  354. 'default' => ""
  355. ),
  356. )
  357. );
  358.  
  359. $this->sections[] = array(
  360. 'type' => 'divide',
  361. );
  362.  
  363. $top_news = function_exists('wmp_get_popular') ? true : false;
  364.  
  365. if ( ! $top_news ) {
  366. $notice_array = array(
  367. 'id'=>'info_success',
  368. 'type'=>'info',
  369. 'style'=>'critical',
  370. 'notice' => true,
  371. 'icon'=>'el-icon-exclamation-sign',
  372. 'title'=> __( 'Plugin Deactivated.', 'themewich' ),
  373. 'desc' => __( 'In order to use the breaking news section, you need to activate the WP Most Popular plugin included with the theme.', 'themewich')
  374. );
  375. } else {
  376. if ( isset($notice_array) ) {
  377. unset($notice_array);
  378. }
  379. }
  380. $news_array = array(
  381. array(
  382. 'id' => 'left-side-section',
  383. 'type' => 'section',
  384. 'title' => __('Left Side', 'themewich'),
  385. 'subtitle' => __('Options for the Left Side of the Top Bar.', 'themewich'),
  386. 'indent' => true // Indent all options below until the next 'section' option is set.
  387. ),
  388. array(
  389. 'id'=>'left-side',
  390. 'type' => 'switch',
  391. 'title' => __('Left Side', 'themewich'),
  392. 'subtitle'=> __('Content on the left side of the top bar.', 'themewich'),
  393. "default" => 1,
  394. 'on' => 'Breaking News Ticker',
  395. 'off' => 'Text',
  396. ),
  397. array(
  398. 'id'=>'left-text',
  399. 'type' => 'editor',
  400. 'required' => array('left-side','=','0'),
  401. 'title' => __('Top Text', 'themewich'),
  402. 'subtitle' => __('Enter text you want in the top left.', 'themewich'),
  403. 'default' => '',
  404. ),
  405. array(
  406. 'id'=>'breaking-number',
  407. 'type' => 'spinner',
  408. 'required' => array('left-side','=','1'),
  409. 'title' => __('Number of Posts to Cycle Through', 'themewich'),
  410. 'subtitle' => __('Select the number of posts to cycle through.', 'themewich'),
  411. "default" => "5",
  412. "min" => "1",
  413. "step" => "1",
  414. "max" => "100",
  415. ),
  416. array(
  417. 'id'=>'breaking-text-switch',
  418. 'type' => 'switch',
  419. 'required' => array('left-side','=','1'),
  420. 'title' => __('Replace "Breaking" Title?', 'themewich'),
  421. 'subtitle'=> __('Turn this on to replace "Breaking" in the top bar.', 'themewich'),
  422. "default" => 0,
  423. ),
  424. array(
  425. 'id'=>'breaking-text',
  426. 'type' => 'text',
  427. 'required' => array('breaking-text-switch','=','1'),
  428. 'title' => __('Change "Breaking" text.', 'themewich'),
  429. 'subtitle' => __('Change "Breaking" to something else.', 'themewich'),
  430. ),
  431. array(
  432. 'id'=>'breaking-timeline',
  433. 'type' => 'select',
  434. 'required' => array('left-side','=','1'),
  435. 'title' => __('Timeline', 'themewich'),
  436. 'subtitle' => __('Select the popularity timeline.', 'themewich'),
  437. 'options' => array('1' => 'All Time','2' => 'Monthly','3' => 'Weekly', '4' => 'Daily'),
  438. 'default' => '2'
  439. ),
  440. array(
  441. 'id'=>'breaking-delay',
  442. 'type' => 'spinner',
  443. 'required' => array('left-side','=','1'),
  444. 'title' => __('Delay between posts.', 'themewich'),
  445. 'subtitle' => __('Select the number of seconds to show each post.', 'themewich'),
  446. "default" => "4",
  447. "min" => "1",
  448. "step" => "1",
  449. "max" => "100",
  450. ),
  451. array(
  452. 'id'=>'breaking-animation',
  453. 'type' => 'select',
  454. 'required' => array('left-side','=','1'),
  455. 'title' => __('Animation', 'themewich'),
  456. 'subtitle' => __('Select the breaking news animation type', 'themewich'),
  457. 'options' => array('1' => 'Ticker','2' => 'Fade', '3' => 'Vertical Slide'),
  458. 'default' => '3'
  459. ),
  460. array(
  461. 'id' => 'right-side-section',
  462. 'type' => 'section',
  463. 'title' => __('Right Side', 'themewich'),
  464. 'subtitle' => __('Options for the Right Side of the Top Bar.', 'themewich'),
  465. 'indent' => true // Indent all options below until the next 'section' option is set.
  466. ),
  467. array(
  468. 'id'=>'right-side',
  469. 'type' => 'switch',
  470. 'title' => __('Right Side', 'themewich'),
  471. 'subtitle'=> __('Content on the left side of the top bar.', 'themewich'),
  472. "default" => 1,
  473. 'on' => 'Social Icons',
  474. 'off' => 'Text',
  475. ),
  476. array(
  477. 'id'=>'right-text',
  478. 'type' => 'editor',
  479. 'required' => array('right-side','=','0'),
  480. 'title' => __('Top Text', 'themewich'),
  481. 'subtitle' => __('Enter text you want in the top right.', 'themewich'),
  482. 'default' => '',
  483. ),
  484. array(
  485. 'id' => 'social-order',
  486. 'type' => 'sortable',
  487. 'mode' => 'checkbox', // checkbox or text
  488. 'title' => __('Social Icons', 'themewich'),
  489. 'required' => array('right-side','=','1'),
  490. 'subtitle' => __('Define which icons you want to show and reorder these however you want.', 'themewich'),
  491. 'options' => array(
  492. 'facebook' => 'Facebook',
  493. 'twitter' => 'Twitter',
  494. 'dribbble' => 'Dribbble',
  495. 'youtube-play' => 'YouTube',
  496. 'vimeo-square' => 'Vimeo',
  497. 'linkedin' => 'LinkedIn',
  498. 'vimeo-square' => 'Vimeo',
  499. 'pinterest' => 'Pinterest',
  500. 'github' => 'Github',
  501. 'google-plus-square' => 'Google+',
  502. 'instagram' => 'Instagram',
  503. 'stack-overflow' => 'Stack Overflow',
  504. 'trello' => 'Trello',
  505. 'tumblr' => 'Tumblr',
  506. ),
  507. //See how default has changed? you also don't need to specify opts that are 0.
  508. 'default' => array(
  509. 'facebook' => '1',
  510. 'twitter' => '1',
  511. 'dribbble' => '1',
  512. 'youtube-play' => '0',
  513. 'vimeo-square' => '0',
  514. 'linkedin' => '0',
  515. 'vimeo-square' => '0',
  516. 'pinterest' => '0',
  517. 'github' => '0',
  518. 'google-plus-square' => '0',
  519. 'instagram' => '0',
  520. 'stack-overflow' => '0',
  521. 'trello' => '0',
  522. 'tumblr' => '0',
  523. )
  524. ),
  525. array(
  526. 'id'=>'social-urls',
  527. 'type' => 'text',
  528. 'customizer' => false,
  529. 'title' => __('Social Link URLs', 'themewich'),
  530. 'subtitle' => __('Enter your social link urls.', 'themewich'),
  531. 'required' => array('right-side','=','1'),
  532. 'options' => array(
  533. 'facebook' => 'Facebook URL',
  534. 'twitter' => 'Twitter URL',
  535. 'dribbble' => 'Dribbble URL',
  536. 'youtube-play' => 'YouTube URL',
  537. 'vimeo-square' => 'Vimeo URL',
  538. 'linkedin' => 'LinkedIn URL',
  539. 'pinterest' => 'Pinterest URL',
  540. 'github' => 'Github URL',
  541. 'google-plus-square' => 'Google+ URL',
  542. 'instagram' => 'Instagram URL',
  543. 'stack-overflow' => 'Stack Overflow URL',
  544. 'trello' => 'Trello URL',
  545. 'tumblr' => 'Tumblr URL',
  546. ),
  547. 'default' => array(
  548. 'facebook' => '',
  549. 'twitter' => '',
  550. 'dribbble' => '',
  551. 'youtube-play' => '',
  552. 'vimeo-square' => '',
  553. 'linkedin' => '',
  554. 'vimeo-square' => '',
  555. 'pinterest' => '',
  556. 'github' => '',
  557. 'google-plus-square' => '',
  558. 'instagram' => '',
  559. 'stack-overflow' => '',
  560. 'trello' => '',
  561. 'tumblr' => '',
  562. ),
  563. ),
  564. );
  565.  
  566. if ( isset($notice_array) ) {
  567. array_unshift($news_array, $notice_array);
  568. }
  569.  
  570. $this->sections[] = array(
  571. 'icon' => 'el-icon-bullhorn',
  572. 'icon_class' => 'icon-large',
  573. 'title' => __('Top Bar', 'themewich'),
  574. 'customizer' => false,
  575. 'desc' => __('Options for the top bar of your theme.', 'themewich'),
  576. 'fields' => $news_array
  577. );
  578.  
  579. $this->sections[] = array(
  580. 'icon' => 'el-icon-pencil',
  581. 'icon_class' => 'icon-large',
  582. 'title' => __('Post Settings', 'themewich'),
  583. 'fields' => array(
  584.  
  585. /* array( // coming soon
  586. 'id'=>'layout',
  587. 'type' => 'image_select',
  588. 'compiler'=>true,
  589. 'title' => __('Default Post Layout', 'themewich'),
  590. 'subtitle' => __('Select the default layout of your posts. You can overwrite this on an individual post setting.', 'themewich'),
  591. 'options' => array(
  592. '1' => array('alt' => '1 Column', 'img' => ReduxFramework::$_url.'assets/img/1col.png'),
  593. '2' => array('alt' => '2 Column Right', 'img' => ReduxFramework::$_url.'assets/img/2cr.png'),
  594. ),
  595. 'default' => '2'
  596. ), */
  597. array(
  598. 'id'=>'auto_dropcap',
  599. 'type' => 'button_set',
  600. 'title' => __('Automatic Dropcap', 'themewich'),
  601. 'subtitle'=> __('Choose whether to display an automatic dropcap for the first letter of your post.', 'themewich'),
  602. 'options' => array('1' => 'On','0' => 'Off'),//Must provide key => value pairs for radio options
  603. 'default' => '1'
  604. ),
  605. array(
  606. 'id'=>'large-top-image',
  607. 'type' => 'button_set',
  608. 'title' => __('Default Featured Image Style', 'themewich'),
  609. 'subtitle'=> __('Choose whether to display the featured image as a large, full-width image at the top of the post.', 'themewich'),
  610. 'options' => array('1' => 'Full Width','0' => 'Regular Width'),//Must provide key => value pairs for radio options
  611. 'default' => '1'
  612. ),
  613. array(
  614. 'id'=>'sharing',
  615. 'type' => 'switch',
  616. 'title' => __('Default Post Sharing', 'themewich'),
  617. 'subtitle'=> __('Display sharing options to the right of the content.', 'themewich'),
  618. "default" => 1,
  619. ),
  620. array(
  621. 'id'=>'related_posts',
  622. 'type' => 'switch',
  623. 'title' => __('Default Related Posts', 'themewich'),
  624. 'subtitle'=> __('Display related posts at the bottom of your posts', 'themewich'),
  625. "default" => 1,
  626. ),
  627. )
  628. );
  629.  
  630. $this->sections[] = array(
  631. 'type' => 'divide',
  632. );
  633.  
  634. $this->sections[] = array(
  635. 'icon' => 'el-icon-font',
  636. 'icon_class' => 'icon-large',
  637. 'title' => __('Theme Fonts', 'themewich'),
  638. 'fields' => array(
  639. array(
  640. 'id' => 'large-headings',
  641. 'type' => 'typography',
  642. 'title' => __('Large Featured Headings', 'themewich'),
  643. 'google' => true, // Disable google fonts. Won't work if you haven't defined your google api key
  644. 'line-height' => false,
  645. 'text-align' => false,
  646. 'letter-spacing'=> true, // Defaults to false
  647. 'text-transform' => true,
  648. 'color' => false,
  649. 'update_weekly' => false,
  650. 'output' => array('.section .slidecaption .slidetitle,
  651. .section .slidecaption h1,
  652. .single-post .pagetitle .title,
  653. #share-box h4'), // An array of CSS selectors to apply this font style to dynamically
  654. 'units' => 'px', // Defaults to px
  655. 'subtitle' => __('Set your font choice for the site-wide large headings. This includes full image posts and slideshow section headings.', 'themewich'),
  656. 'default' => array(
  657. 'font-weight'=>'900',
  658. 'font-family'=>'Lato',
  659. 'text-transform' => 'uppercase',
  660. 'google' => true,
  661. 'font-size'=>'60px',
  662. 'line-height' => '1em'
  663. ),
  664. ),
  665. array(
  666. 'id'=>'medium-headings',
  667. 'type' => 'typography',
  668. 'title' => __('Medium Featured Headings', 'themewich'),
  669. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  670. 'line-height'=>false,
  671. 'text-align' => false,
  672. 'letter-spacing'=>true, // Defaults to false
  673. 'text-transform'=>true,
  674. 'update_weekly' => false,
  675. 'color'=>false,
  676. 'output' => array('.grid .thumbovertext .title,
  677. .carousel .carouselpost .thumbovertext .title,
  678. .full-image-section .fullsection .title,
  679. .single .no-full-image h1.title'), // An array of CSS selectors to apply this font style to dynamically
  680. 'units'=>'px', // Defaults to px
  681. 'subtitle'=> __('Set your font choice for the site-wide medium headings. This includes large grid, regular single post and full width link section headings.', 'themewich'),
  682. 'default'=> array(
  683. 'font-weight'=>'900',
  684. 'font-family'=>'Lato',
  685. 'text-transform' => 'uppercase',
  686. 'google' => true,
  687. 'font-size'=>'44px',
  688. 'line-height' => '1em'
  689. ),
  690. ),
  691.  
  692. array(
  693. 'id'=>'small-headings',
  694. 'type' => 'typography',
  695. 'title' => __('Small Featured Headings', 'themewich'),
  696. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  697. 'line-height'=>false,
  698. 'text-align' => false,
  699. 'letter-spacing'=>true, // Defaults to false
  700. 'text-transform'=>true,
  701. 'update_weekly' => false,
  702. 'color'=>false,
  703. 'output' => array('.regulargrid .title,
  704. .carousel.half-carousel .carouselpost .thumbovertext .title,
  705. .halfgrid .thumbovertext .title,
  706. .related .thumbovertext .title'), // An array of CSS selectors to apply this font style to dynamically
  707. 'units'=>'px', // Defaults to px
  708. 'subtitle'=> __('Set your font choice for the site-wide small headings. This includes small grid headings, regular post index headings and section titles.', 'themewich'),
  709. 'default'=> array(
  710. 'font-weight'=>'900',
  711. 'font-family'=>'Lato',
  712. 'text-transform' => 'uppercase',
  713. 'google' => true,
  714. 'font-size'=>'28px',
  715. 'line-height' => '1em'
  716. ),
  717. ),
  718.  
  719. array(
  720. 'id'=>'default-headings',
  721. 'type' => 'typography',
  722. 'title' => __('Default Theme Headings', 'themewich'),
  723. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  724. 'line-height'=>false,
  725. 'text-align' => false,
  726. 'letter-spacing'=>true, // Defaults to false
  727. 'text-transform'=>true,
  728. 'update_weekly' => false,
  729. 'color'=>false,
  730. 'output' => array('.pagetitle .title,
  731. #logo a,
  732. .full-post .full-image-section .fullsection .title'), // An array of CSS selectors to apply this font style to dynamically
  733. 'units'=>'px', // Defaults to px
  734. 'subtitle'=> __('Set your font choice for the site-wide default headings. This includes page titles and full width post sections.', 'themewich'),
  735. 'default'=> array(
  736. 'font-weight'=>'900',
  737. 'font-family'=>'Lato',
  738. 'text-transform' => 'uppercase',
  739. 'google' => true,
  740. 'font-size'=>'32px',
  741. 'line-height' => '1em'
  742. ),
  743. ),
  744.  
  745.  
  746. array(
  747. 'id'=>'subtitles',
  748. 'type' => 'typography',
  749. 'title' => __('Theme Subtitles', 'themewich'),
  750. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  751. 'line-height'=>false,
  752. 'font-size'=>false,
  753. 'letter-spacing'=>true, // Defaults to false
  754. 'text-transform'=>true,
  755. 'update_weekly' => false,
  756. 'color'=>false,
  757. 'output' => array('.pagertitle, .full-taxonomy .fullsection .subtitle, .pagetitle .subheadline'), // An array of CSS selectors to apply this font style to dynamically
  758. 'units'=>'px', // Defaults to px
  759. 'subtitle'=> __('Set your font choice for the site-wide subtitle fonts.', 'themewich'),
  760. 'default'=> array(
  761. 'font-weight'=>'300',
  762. 'font-family'=>'Lato',
  763. 'google' => true,
  764. 'font-size'=>'20px',
  765. 'line-height' => '18px'),
  766. ),
  767.  
  768.  
  769. array(
  770. 'id'=>'section-titles',
  771. 'type' => 'typography',
  772. 'title' => __('Section and Widget Titles', 'themewich'),
  773. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  774. 'line-height'=>false,
  775. 'text-align' => false,
  776. 'letter-spacing'=>true, // Defaults to false
  777. 'text-transform'=>true,
  778. 'text-transform'=>true,
  779. 'update_weekly' => false,
  780. 'font-size' =>false,
  781. 'color'=>false,
  782. 'output' => array(
  783. '.section-title span,
  784. .widget h3.widget-title,
  785. .widget h2.widget-title,
  786. .widget h4.widget-title'), // An array of CSS selectors to apply this font style to dynamically
  787. 'units'=>'px', // Defaults to px
  788. 'subtitle'=> __('Set your font choice for the section titles.', 'themewich'),
  789. 'default'=> array(
  790. 'font-weight'=>'700',
  791. 'font-family'=>'Lato',
  792. 'text-transform' => 'uppercase',
  793. 'letter-spacing' => '1px',
  794. 'google' => true,
  795. 'font-size'=>'22px'),
  796. ),
  797.  
  798. array(
  799. 'id'=>'top-nav-font',
  800. 'type' => 'typography',
  801. 'title' => __('Top Level Navigation Font', 'themewich'),
  802. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  803. 'line-height'=>false,
  804. 'text-align' => false,
  805. 'letter-spacing'=>true, // Defaults to false
  806. 'text-transform'=>true,
  807. 'update_weekly' => false,
  808. 'color'=>false,
  809. 'output' => array('.sf-menu li > a'), // An array of CSS selectors to apply this font style to dynamically
  810. 'units'=>'px', // Defaults to px
  811. 'subtitle'=> __('Set your font choice for your top level site navigation and megamenu headings.', 'themewich'),
  812. 'default'=> array(
  813. 'color'=>"#777",
  814. 'font-weight'=>'600',
  815. 'font-family'=>'Lato',
  816. 'google' => true,
  817. 'letter-spacing' => '1px',
  818. 'font-size'=>'12px',
  819. 'line-height' => '1em',
  820. 'text-transform' => 'uppercase'),
  821. ),
  822.  
  823. array(
  824. 'id'=>'tiny-details',
  825. 'type' => 'typography',
  826. 'title' => __('Tiny Details Font', 'themewich'),
  827. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  828. 'line-height'=>false,
  829. 'text-align' => false,
  830. 'letter-spacing'=>true, // Defaults to false
  831. 'text-transform'=>true,
  832. 'text-transform'=>true,
  833. 'update_weekly' => false,
  834. 'color'=>false,
  835. 'output' => array(
  836. '.tiny-details, .badge, .badge a, .thumboverdate,
  837. .badgesliver, .sharing a .sharetitle, a.button.outline,
  838. a.more-link, .tagcloud.badge h5,
  839. a.post-edit-link, .tabswrap ul.tabs li a,
  840. ul.sf-menu li.megamenu .menu-item-type-custom > a,
  841. ul.sf-menu li.megamenu .menu-item-type-custom .menu-item-type-custom > a,
  842. .breaking, .breaking-title, .divider span, cite,
  843. #breadcrumbs li'), // An array of CSS selectors to apply this font style to dynamically
  844. 'units'=>'px', // Defaults to px
  845. 'subtitle'=> __('Set your font choice for the headers.', 'themewich'),
  846. 'default'=> array(
  847. 'font-weight'=>'400',
  848. 'font-family'=>'Lato',
  849. 'text-transform' => 'uppercase',
  850. 'letter-spacing' => '2px',
  851. 'google' => true,
  852. 'line-height' => '1em',
  853. 'font-size'=>'10px'),
  854. ),
  855.  
  856. ),
  857. );
  858.  
  859. $this->sections[] = array(
  860. 'icon' => 'el-icon-fontsize',
  861. 'icon_class' => 'icon-large',
  862. 'title' => __('Content Fonts', 'themewich'),
  863. 'fields' => array(
  864.  
  865. array(
  866. 'id'=>'heading-font',
  867. 'type' => 'typography',
  868. 'title' => __('H1 Heading Font', 'themewich'),
  869. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  870. 'line-height'=>false,
  871. 'text-align' => false,
  872. 'letter-spacing'=>true, // Defaults to false
  873. 'text-transform'=>true,
  874. 'update_weekly' => false,
  875. 'color'=>false,
  876. 'output' => array('h1, .postcontent.no-review > p:first-child:first-letter'), // An array of CSS selectors to apply this font style to dynamically
  877. 'units'=>'px', // Defaults to px
  878. 'subtitle'=> __('Set your font choice for the headers.', 'themewich'),
  879. 'default'=> array(
  880. 'color'=>"#333",
  881. 'font-weight'=>'300',
  882. 'font-family'=>'Lato',
  883. 'google' => true,
  884. 'font-size'=>'58px',
  885. 'line-height' => '2em'),
  886. ),
  887.  
  888. array(
  889. 'id'=>'heading-font2',
  890. 'type' => 'typography',
  891. 'title' => __('H2 Heading Font', 'themewich'),
  892. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  893. 'line-height'=>false,
  894. 'text-align' => false,
  895. 'letter-spacing'=>true, // Defaults to false
  896. 'text-transform'=>true,
  897. 'update_weekly' => false,
  898. 'color'=>false,
  899. 'output' => array('h2, blockquote, blockquote p'), // An array of CSS selectors to apply this font style to dynamically
  900. 'units'=>'px', // Defaults to px
  901. 'subtitle'=> __('Set your font choice for the headers.', 'themewich'),
  902. 'default'=> array(
  903. 'color'=>"#333",
  904. 'font-weight'=>'300',
  905. 'font-family'=>'Lato',
  906. 'google' => true,
  907. 'font-size'=>'28px',
  908. 'line-height' => '2em'),
  909. ),
  910.  
  911. array(
  912. 'id'=>'heading-font3',
  913. 'type' => 'typography',
  914. 'title' => __('H3 Heading Font', 'themewich'),
  915. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  916. 'line-height'=>false,
  917. 'text-align' => false,
  918. 'letter-spacing'=>true, // Defaults to false
  919. 'text-transform'=>true,
  920. 'update_weekly' => false,
  921. 'color'=>false,
  922. 'output' => array('h3'), // An array of CSS selectors to apply this font style to dynamically
  923. 'units'=>'px', // Defaults to px
  924. 'subtitle'=> __('Set your font choice for the headers.', 'themewich'),
  925. 'default'=> array(
  926. 'color'=>"#333",
  927. 'font-weight'=>'400',
  928. 'font-family'=>'Lato',
  929. 'google' => true,
  930. 'font-size'=>'22px',
  931. 'line-height' => '2em'),
  932. ),
  933.  
  934. array(
  935. 'id'=>'heading-font4-6',
  936. 'type' => 'typography',
  937. 'title' => __('H4 - H6 Heading Fonts', 'themewich'),
  938. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  939. 'line-height'=>false,
  940. 'text-align' => false,
  941. 'letter-spacing'=>true, // Defaults to false
  942. 'text-transform'=>true,
  943. 'update_weekly' => false,
  944. 'color'=>false,
  945. 'output' => array('h4, h5, h6'), // An array of CSS selectors to apply this font style to dynamically
  946. 'units'=>'px', // Defaults to px
  947. 'font-size'=>false,
  948. 'subtitle'=> __('Set your font choice for the headers.', 'themewich'),
  949. 'default'=> array(
  950. 'color'=>"#333",
  951. 'font-weight'=>'700',
  952. 'font-family'=>'Lato',
  953. 'google' => true,
  954. 'font-size'=>'18px',
  955. 'line-height' => '2em'),
  956. ),
  957.  
  958. array(
  959. 'id'=>'paragraph-type',
  960. 'type' => 'typography',
  961. 'title' => __('Paragraph and Body Font', 'themewich'),
  962. 'google'=>true, // Disable google fonts. Won't work if you haven't defined your google api key
  963. 'line-height'=>false,
  964. 'text-align' => false,
  965. 'letter-spacing'=>true, // Defaults to false
  966. 'text-transform'=>true,
  967. 'update_weekly' => false,
  968. 'color'=>false,
  969. 'output' => array('p, ul, ol, body, h4.review-title'), // An array of CSS selectors to apply this font style to dynamically
  970. 'units'=>'px', // Defaults to px
  971. 'subtitle'=> __('Set your font choice for the site-wide page headers and main slideshow title.', 'themewich'),
  972. 'default'=> array(
  973. 'color'=>"#333",
  974. 'font-weight'=>'400',
  975. 'font-family'=>'Lato',
  976. 'google' => true,
  977. 'font-size'=>'16px',
  978. 'line-height' => '2em'),
  979. ),
  980. )
  981. );
  982.  
  983. if ( function_exists('wp_get_theme') ) {
  984. $theme_data = wp_get_theme();
  985. $theme_uri = $theme_data->get('ThemeURI');
  986. $description = $theme_data->get('Description');
  987. $author = $theme_data->get('Author');
  988. $version = $theme_data->get('Version');
  989. $tags = $theme_data->get('Tags');
  990. } else {
  991. $theme_data = wp_get_theme(trailingslashit(get_stylesheet_directory()).'style.css');
  992. $theme_uri = $theme_data['URI'];
  993. $description = $theme_data['Description'];
  994. $author = $theme_data['Author'];
  995. $version = $theme_data['Version'];
  996. $tags = $theme_data['Tags'];
  997. }
  998.  
  999. $theme_info = '<div class="redux-framework-section-desc">';
  1000. $theme_info .= '<p class="redux-framework-theme-data description theme-uri">'.__('<strong>Theme URL:</strong> ', 'themewich').'<a href="'.$theme_uri.'" target="_blank">'.$theme_uri.'</a></p>';
  1001. $theme_info .= '<p class="redux-framework-theme-data description theme-author">'.__('<strong>Author:</strong> ', 'themewich').$author.'</p>';
  1002. $theme_info .= '<p class="redux-framework-theme-data description theme-version">'.__('<strong>Version:</strong> ', 'themewich').$version.'</p>';
  1003. $theme_info .= '<p class="redux-framework-theme-data description theme-description">'.$description.'</p>';
  1004. if ( !empty( $tags ) ) {
  1005. $theme_info .= '<p class="redux-framework-theme-data description theme-tags">'.__('<strong>Tags:</strong> ', 'themewich').implode(', ', $tags).'</p>';
  1006. }
  1007. $theme_info .= '</div>';
  1008.  
  1009. $this->sections[] = array(
  1010. 'type' => 'divide',
  1011. );
  1012.  
  1013. $this->sections[] = array(
  1014. 'icon' => 'el-icon-download',
  1015. 'title' => __('Updates', 'themewich'),
  1016. 'desc' => __('<p class="description">Get Automatic Theme Updates</p>', 'themewich'),
  1017. 'fields' => array(
  1018. array(
  1019. 'id'=>'tf_username',
  1020. 'type' => 'text',
  1021. 'title' => __('Themeforest Username', 'themewich'),
  1022. 'subtitle' => __('Enter your Themeforest Username that you used to purchase the this theme.', 'themewich'),
  1023. ),
  1024. array(
  1025. 'id'=>'tf_api',
  1026. 'type' => 'text',
  1027. 'title' => __('Themeforest API Key', 'themewich'),
  1028. 'subtitle' => __('You can find your API key by Logging into Themeforest, visiting your Dashboard page then clicking the My Settings tab. At the bottom of the page you will find your account API key and a button to regenerate it as needed.', 'themewich'),
  1029. ),
  1030. array(
  1031. 'id'=>'raw_new_info',
  1032. 'title' => __('Your Version', 'themewich'),
  1033. 'type' => 'raw',
  1034. 'content' => $item_info,
  1035. )
  1036. ),
  1037. );
  1038.  
  1039. $this->sections[] = array(
  1040. 'icon' => 'el-icon-dashboard',
  1041. 'title' => __('Advanced', 'themewich'),
  1042. 'desc' => '<p class="description">' . __('Advanced Options</p>', 'themewich') . '</p>',
  1043. 'fields' => array(
  1044. array(
  1045. 'id'=>'help_page',
  1046. 'type' => 'switch',
  1047. 'title' => __('Show Help Page', 'themewich'),
  1048. 'subtitle'=> __('Turn this off to hide the help page.', 'themewich'),
  1049. "default" => 1,
  1050. ),
  1051. ),
  1052. );
  1053. }
  1054.  
  1055. public function setHelpTabs() {
  1056.  
  1057. // Custom page help tabs, displayed using the help API. Tabs are shown in order of definition.
  1058. $this->args['help_tabs'][] = array(
  1059. 'id' => 'redux-opts-1',
  1060. 'title' => __('Theme Information 1', 'themewich'),
  1061. 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'themewich')
  1062. );
  1063.  
  1064. $this->args['help_tabs'][] = array(
  1065. 'id' => 'redux-opts-2',
  1066. 'title' => __('Theme Information 2', 'themewich'),
  1067. 'content' => __('<p>This is the tab content, HTML is allowed.</p>', 'themewich')
  1068. );
  1069.  
  1070. // Set the help sidebar
  1071. $this->args['help_sidebar'] = __('<p>This is the sidebar content, HTML is allowed.</p>', 'themewich');
  1072. }
  1073.  
  1074. /**
  1075.  
  1076. All the possible arguments for Redux.
  1077. For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments
  1078.  
  1079. * */
  1080. public function setArguments() {
  1081.  
  1082. $theme = wp_get_theme(); // For use with some settings. Not necessary.
  1083.  
  1084. $this->args = array(
  1085. // TYPICAL -> Change these values as you need/desire
  1086. 'opt_name' => 'tw_options', // This is where your data is stored in the database and also becomes your global variable name.
  1087. 'display_name' => $theme->get('Name'), // Name that appears at the top of your panel
  1088. 'display_version' => $theme->get('Version'), // Version that appears at the top of your panel
  1089. 'menu_type' => 'menu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
  1090. 'allow_sub_menu' => true, // Show the sections below the admin menu item or not
  1091. 'menu_title' => __('Theme Options', 'themewich'),
  1092. 'page' => __('Theme Options', 'themewich'),
  1093. // You will need to generate a Google API key to use this feature.
  1094. // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth
  1095. 'google_api_key' => 'AIzaSyBvTFqTI2TwUiB8SaDfHrZM3TnH_qsE4aw', // Must be defined to add google fonts to the typography module
  1096. //'admin_bar' => false, // Show the panel pages on the admin bar
  1097. 'global_variable' => '', // Set a different name for your global variable other than the opt_name
  1098. 'dev_mode' => false, // Show the time the page took to load, etc
  1099. 'customizer' => true, // Enable basic customizer support
  1100. // OPTIONAL -> Give you extra features
  1101. 'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
  1102. 'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
  1103. 'page_permissions' => 'manage_options', // Permissions needed to access the options panel.
  1104. 'menu_icon' => '', // Specify a custom URL to an icon
  1105. 'last_tab' => '', // Force your panel to always open to a specific tab (by id)
  1106. 'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title
  1107. 'page_slug' => '_options', // Page slug used to denote the panel
  1108. 'save_defaults' => true, // On load save the defaults to DB before user clicks save or not
  1109. 'default_show' => false, // If true, shows the default value next to each field that is not the default value.
  1110. 'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *
  1111. // CAREFUL -> These options are for advanced use only
  1112. 'transient_time' => 60 * MINUTE_IN_SECONDS,
  1113. 'output' => true, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
  1114. 'output_tag' => true, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
  1115. //'domain' => 'redux-framework', // Translation domain key. Don't change this unless you want to retranslate all of Redux.
  1116. 'footer_credit' => 'Thank you for creating with <a href="http://themewich.com" target="_blank">Themewich</a>. Powered by the <a href="https://github.com/ReduxFramework/ReduxFramework" target="_blank">Redux Options Framework.</a>', // Disable the footer credit of Redux. Please leave if you can help it.
  1117. // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.
  1118. 'database' => '', // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!
  1119. 'show_import_export' => true, // REMOVE
  1120. 'system_info' => false, // REMOVE
  1121. 'help_tabs' => array(),
  1122. 'help_sidebar' => '', // __( '', $this->args['domain'] );
  1123. // HINTS
  1124. 'hints' => array(
  1125. 'icon' => 'icon-question-sign',
  1126. 'icon_position' => 'right',
  1127. 'icon_color' => 'lightgray',
  1128. 'icon_size' => 'normal',
  1129. 'tip_style' => array(
  1130. 'color' => 'light',
  1131. 'shadow' => true,
  1132. 'rounded' => false,
  1133. 'style' => 'bootstrap',
  1134. ),
  1135. 'tip_position' => array(
  1136. 'my' => 'bottom left',
  1137. 'at' => 'top right',
  1138. ),
  1139. 'tip_effect' => array(
  1140. 'show' => array(
  1141. 'effect' => 'fade',
  1142. 'duration' => '500',
  1143. 'event' => 'mouseover',
  1144. ),
  1145. 'hide' => array(
  1146. 'effect' => 'fade',
  1147. 'duration' => '500',
  1148. 'event' => 'click mouseleave',
  1149. ),
  1150. ),
  1151. ),
  1152. );
  1153.  
  1154.  
  1155. // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons.
  1156. $this->args['share_icons'][] = array(
  1157. 'url' => 'http://twitter.com/ajgagnon',
  1158. 'title' => 'Visit me on Twitter',
  1159. 'icon' => 'el-icon-twitter'
  1160. // 'img' => '', // You can use icon OR img. IMG needs to be a full URL.
  1161. );
  1162. $this->args['share_icons'][] = array(
  1163. 'url' => 'http://dribbble.com/ajgagnon',
  1164. 'title' => 'Find me on Dribbble',
  1165. 'icon' => ' el-icon-dribbble'
  1166. );
  1167. $this->args['share_icons'][] = array(
  1168. 'url' => 'http://themeforest.net/user/2winFactor',
  1169. 'title' => 'Follow me on Themeforest',
  1170. 'icon' => 'el-icon-leaf'
  1171. );
  1172. $this->args['share_icons'][] = array(
  1173. 'url' => 'http://support.themewich.com',
  1174. 'title' => 'Get Support',
  1175. 'icon' => 'el-icon-group'
  1176. );
  1177.  
  1178. // Add content after the form.
  1179. $this->args['footer_text'] = __('<p style="margin-top:20px;"><a class="icon-a icon-gallery" href="http://themeforest.net/user/2winFactor/portfolio?ref=2winfactor" target="_blank" style="font-size:14px; color:#777; text-decoration:none; margin-right:10px;"><i class="el-icon-website"></i> More Themes</a>
  1180. <a class="icon-a icon-support" href="http://support.themewich.com" target="_blank" style="font-size:14px; color:#777; text-decoration:none; margin-right:10px;"><i class="el-icon-group"></i> Support Forum</a>
  1181. <a class="icon-a icon-documentation" href="' . get_template_directory_uri() . '/pdf/documentation.pdf" target="_blank" style="font-size:14px; color:#777; text-decoration:none; margin-right:10px;"><i class="el-icon-paper-clip"></i> Documentation</a>
  1182. </p>', 'themewich');
  1183. }
  1184.  
  1185. }
  1186.  
  1187. new Themewich_Options_Config();
  1188. }
  1189.  
  1190.  
  1191. /**
  1192.  
  1193. Custom function for the callback referenced above
  1194.  
  1195. */
  1196. if (!function_exists('redux_my_custom_field')):
  1197.  
  1198. function redux_my_custom_field($field, $value) {
  1199. print_r($field);
  1200. print_r($value);
  1201. }
  1202.  
  1203. endif;
  1204.  
  1205. /**
  1206.  
  1207. Custom function for the callback validation referenced above
  1208.  
  1209. * */
  1210. if (!function_exists('redux_validate_callback_function')):
  1211.  
  1212. function redux_validate_callback_function($field, $value, $existing_value) {
  1213. $error = false;
  1214. $value = 'just testing';
  1215. /*
  1216. do your validation
  1217.  
  1218. if(something) {
  1219. $value = $value;
  1220. } elseif(something else) {
  1221. $error = true;
  1222. $value = $existing_value;
  1223. $field['msg'] = 'your custom error message';
  1224. }
  1225. */
  1226.  
  1227. $return['value'] = $value;
  1228. if ($error == true) {
  1229. $return['error'] = $field;
  1230. }
  1231. return $return;
  1232. }
  1233.  
  1234.  
  1235. endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement