initSettings(); } else { add_action('plugins_loaded', array($this, 'initSettings'), 10); } } public function initSettings() { // Just for demo purposes. Not needed per say. $this->theme = wp_get_theme(); // Set the default arguments $this->setArguments(); // Set a few help tabs so you can see how it's done //$this->setHelpTabs(); // Create the sections and fields $this->setSections(); if (!isset($this->args['opt_name'])) { // No errors please return; } // If Redux is running as a plugin, this will remove the demo notice and links add_action( 'redux/loaded', array( $this, 'remove_demo' ) ); // Function to test the compiler hook and demo CSS output. // Above 10 is a priority, but 2 in necessary to include the dynamically generated CSS to be sent to the function. //add_filter('redux/options/'.$this->args['opt_name'].'/compiler', array( $this, 'compiler_action' ), 10, 2); // Change the arguments after they've been declared, but before the panel is created //add_filter('redux/options/'.$this->args['opt_name'].'/args', array( $this, 'change_arguments' ) ); // Change the default value of a field after it's been set, but before it's been useds //add_filter('redux/options/'.$this->args['opt_name'].'/defaults', array( $this,'change_defaults' ) ); // Dynamically add a section. Can be also used to modify sections/fields //add_filter('redux/options/' . $this->args['opt_name'] . '/sections', array($this, 'dynamic_section')); $this->ReduxFramework = new ReduxFramework($this->sections, $this->args); } /** This is a test function that will let you see when the compiler hook occurs. It only runs if a field set with compiler=>true is changed. * */ function compiler_action($options, $css) { //echo '
theme->display('Description')); ?>
theme->parent()) { printf('' . wp_kses_data(__('This child theme requires its parent theme, %2$s.', 'blogup')) . '
', esc_html__('http://codex.wordpress.org/Child_Themes', 'blogup'), $this->theme->parent()->display('Name')); } ?>' . esc_html__('Theme URL: ', 'blogup') . '' . $this->theme->get('ThemeURI') . '
'; $theme_info .= ''; $theme_info .= '' . esc_html__('Version: ', 'blogup') . $this->theme->get('Version') . '
'; $theme_info .= '' . $this->theme->get('Description') . '
'; $tabs = $this->theme->get('Tags'); if (!empty($tabs)) { $theme_info .= ''; } $theme_info .= 'More about our theme.
', 'blogup'), 'fields' => array( array( 'id' => 'opt-raw-info', 'type' => 'raw', 'content' => $item_info, ) ), ); if (file_exists(get_theme_file_path('README.html'))) { $tabs['docs'] = array( 'icon' => 'el-icon-book', 'title' => esc_html__('Documentation', 'blogup'), //'content' => nl2br(blogup_read_file(get_theme_file_path(),'README.html')) ); } } public function setHelpTabs() { // Custom page help tabs, displayed using the help API. Tabs are shown in order of definition. $this->args['help_tabs'][] = array( 'id' => 'redux-help-tab-1', 'title' => esc_html__('Theme Information 1', 'blogup'), 'content' => esc_html__('This is the tab content, HTML is allowed.
', 'blogup') ); $this->args['help_tabs'][] = array( 'id' => 'redux-help-tab-2', 'title' => esc_html__('Theme Information 2', 'blogup'), 'content' => esc_html__('This is the tab content, HTML is allowed.
', 'blogup') ); // Set the help sidebar $this->args['help_sidebar'] = esc_html__('This is the sidebar content, HTML is allowed.
', 'blogup'); } /** All the possible arguments for Redux. For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments * */ public function setArguments() { $theme = wp_get_theme(); // For use with some settings. Not necessary. $this->args = array( 'opt_name' => REDUX_OPT_NAME, 'dev_mode' => false, 'page_slug' => 'rs_theme_options', 'page_title' => 'Options', 'page_parent' => 'rs_theme_welcome', 'update_notice' => true, 'intro_text' => 'Theme Options Panel
', 'footer_text' => '', 'admin_bar' => true, 'menu_type' => 'submenu', 'menu_title' => 'Theme Options', 'allow_sub_menu' => true, 'page_parent_post_type' => 'your_post_type', 'customizer' => true, 'default_mark' => '*', 'hints' => array( 'icon' => 'el-icon-question-sign', 'icon_position' => 'right', 'icon_size' => 'normal', 'tip_style' => array( 'color' => 'light', ), 'tip_position' => array( 'my' => 'top left', 'at' => 'bottom right', ), 'tip_effect' => array( 'show' => array( 'duration' => '500', 'event' => 'mouseover', ), 'hide' => array( 'duration' => '500', 'event' => 'mouseleave unfocus', ), ), ), 'output' => true, 'output_tag' => true, 'compiler' => true, 'page_icon' => 'icon-themes', 'show_options_object' => false, 'page_permissions' => 'manage_options', 'save_defaults' => true, 'show_import_export' => false, 'transient_time' => '3600', 'network_sites' => true, ); $theme = wp_get_theme(); // For use with some settings. Not necessary. $this->args["display_name"] = $theme->get("Name"); $this->args["display_version"] = $theme->get("Version"); //SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons. // $this->args['share_icons'][] = array( // 'url' => '', // 'title' => 'Visit us on GitHub', // 'icon' => 'el-icon-github' // //'img' => '', // You can use icon OR img. IMG needs to be a full URL. // ); // $this->args['share_icons'][] = array( // 'url' => '', // 'title' => 'Like us on Facebook', // 'icon' => 'el-icon-facebook' // ); // $this->args['share_icons'][] = array( // 'url' => '', // 'title' => 'Follow us on Twitter', // 'icon' => 'el-icon-twitter' // ); // $this->args['share_icons'][] = array( // 'url' => '', // 'title' => 'Find us on LinkedIn', // 'icon' => 'el-icon-linkedin' // ); } } global $reduxConfig; $reduxConfig = new blogup_Redux_Framework_config(); } function blogup_remove_redux_menu() { remove_submenu_page('tools.php','redux-about'); } add_action( 'admin_menu', 'blogup_remove_redux_menu',12 );