public function add_theme_options($sections) { if (function_exists('icl_object_id') && apply_filters('g1_disable_home_page_choices_translation', true)) { global $sitepress; $default_lang = $sitepress->get_default_language(); $current_lang = $sitepress->get_current_language(); $sitepress->switch_lang($default_lang); $home_page_choices = G1_Pages_Module()->get_choices(); $sitepress->switch_lang($current_lang); } else { $home_page_choices = G1_Pages_Module()->get_choices(); } $sections['pages'] = array('priority' => 200, 'icon' => 'edit', 'icon_class' => 'icon-large', 'title' => __('Pages', Redux_TEXT_DOMAIN), 'fields' => array(array('id' => 'post_type_page_home_page', 'priority' => 1, 'type' => 'select', 'title' => __('Home Page', Redux_TEXT_DOMAIN), 'desc' => '<p>' . __('If you want to set the Blog Page as the Home Page, leave this option blank or select the Blog Page.', Redux_TEXT_DOMAIN) . '</p>', 'sub_desc' => __('Which page should be the home page?', Redux_TEXT_DOMAIN), 'options' => array('' => '') + $home_page_choices), array('id' => 'post_type_page_comment_status', 'priority' => 10, 'type' => 'select', 'title' => __('Allow Comments', Redux_TEXT_DOMAIN), 'sub_desc' => __('These setting may be overridden for individual page.', Redux_TEXT_DOMAIN), 'options' => array('open' => __('on', Redux_TEXT_DOMAIN), 'closed' => __('off', Redux_TEXT_DOMAIN)), 'switch' => true, 'std' => 'closed'), array('id' => 'post_type_page_ping_status', 'priority' => 20, 'type' => 'select', 'title' => __('Allow Trackbacks And Pingbacks', Redux_TEXT_DOMAIN), 'sub_desc' => __('These setting may be overridden for individual page.', Redux_TEXT_DOMAIN), 'options' => array('open' => __('on', Redux_TEXT_DOMAIN), 'closed' => __('off', Redux_TEXT_DOMAIN)), 'switch' => true, 'std' => 'closed'))); return $sections; }
/** * Add some stuff to the Theme Options Panel * * @param $sections */ public function add_post_type_settings($sections) { foreach ($this->get_post_types() as $post_type) { $id = 'post_type_' . $post_type . '_page_for_posts'; $section_id = G1_Archive_Settings_Feature()->get_section_id($post_type); if (!empty($sections[$section_id])) { $options = array('' => ''); $options = $options + G1_Pages_Module()->get_choices(); $std = ''; if (!empty($options)) { $std = array_keys($options); $std = $std[0]; } $sections[$section_id]['fields'][] = array('id' => $id, 'priority' => 10, 'type' => 'select', 'title' => __('Archive Page', Redux_TEXT_DOMAIN), 'sub_desc' => '<p>' . __('A few points about this page:', Redux_TEXT_DOMAIN) . '</p>' . '<ul>' . '<li>' . __('A page template will be ignored. Instead one of the below templates will be used.', Redux_TEXT_DOMAIN) . '</li>' . '<li>' . __('Any content will be ignored.', Redux_TEXT_DOMAIN) . '</li>' . '<li>' . __('All other elements ( like title, sidebar, background, etc. ) should work fine.', Redux_TEXT_DOMAIN) . '</li>' . '</ul>', 'options' => $options, 'std' => $std); } } return $sections; }
/** * For the full license information, please view the Licensing folder * that was distributed with this source code. * * @package G1_Theme03 * @subpackage G1_Pages_Module * @since G1_Pages_Module 1.0.0 */ // Prevent direct script access if (!defined('ABSPATH')) { die('No direct script access allowed'); } require_once trailingslashit(dirname(__FILE__)) . 'lib/functions.php'; add_theme_support('post-thumbnails', array('page')); /** * Quasi-singleton for our module * * @return G1_Pages_Module */ function G1_Pages_Module() { static $instance; if (!isset($instance)) { $instance = new G1_Pages_Module(); } return $instance; } // Fire in the hole :) G1_Pages_Module(); require_once trailingslashit(dirname(__FILE__)) . 'lib/shortcodes.php';