コード例 #1
0
ファイル: options.php プロジェクト: emarket-design/wpas-theme
/**
 * Defines an array of options that will be used to generate the settings page and be saved in the database.
 * When creating the 'id' fields, make sure to use all lowercase and no spaces.
 *
 * If you are making your theme translatable, you should replace 'wpas'
 * with the actual text domain for your theme.  Read more:
 * http://codex.wordpress.org/Function_Reference/load_theme_textdomain
 */
function optionsframework_options()
{
    // If using image radio buttons, define a directory path
    $imagepath = trailingslashit(get_template_directory_uri()) . 'images/';
    // Background Defaults
    $background_defaults = array('color' => '#222222', 'image' => $imagepath . 'dark-noise.jpg', 'repeat' => 'repeat', 'position' => 'top left', 'attachment' => 'scroll');
    // Editor settings
    $wp_editor_settings = array('wpautop' => true, 'textarea_rows' => 5, 'tinymce' => array('plugins' => 'wordpress'));
    // Footer Position settings
    $footer_position_settings = array('left' => esc_html__('Left aligned', 'wpas'), 'center' => esc_html__('Center aligned', 'wpas'), 'right' => esc_html__('Right aligned', 'wpas'));
    // Number of shop products
    $shop_products_settings = array('4' => esc_html__('4 Products', 'wpas'), '8' => esc_html__('8 Products', 'wpas'), '12' => esc_html__('12 Products', 'wpas'), '16' => esc_html__('16 Products', 'wpas'), '20' => esc_html__('20 Products', 'wpas'), '24' => esc_html__('24 Products', 'wpas'), '28' => esc_html__('28 Products', 'wpas'));
    $options = array();
    $options[] = array('name' => esc_html__('Basic Settings', 'wpas'), 'type' => 'heading');
    $options[] = array('name' => esc_html__('Background', 'wpas'), 'desc' => sprintf(wp_kses(__('If you&rsquo;d like to replace or remove the default background image, use the <a href="%1$s" title="Custom background">Appearance &gt; Background</a> menu option.', 'wpas'), array('a' => array('href' => array(), 'title' => array()))), admin_url('themes.php?page=custom-background')), 'type' => 'info');
    $options[] = array('name' => esc_html__('Logo', 'wpas'), 'desc' => sprintf(wp_kses(__('If you&rsquo;d like to replace or remove the default logo, use the <a href="%1$s" title="Custom header">Appearance &gt; Header</a> menu option.', 'wpas'), array('a' => array('href' => array(), 'title' => array()))), admin_url('themes.php?page=custom-header')), 'type' => 'info');
    $options[] = array('name' => esc_html__('Social Media Settings', 'wpas'), 'desc' => esc_html__('Enter the URLs for your Social Media platforms. You can also optionally specify whether you want these links opened in a new browser tab/window.', 'wpas'), 'type' => 'info');
    $options[] = array('name' => esc_html__('Open links in new Window/Tab', 'wpas'), 'desc' => esc_html__('Open the social media links in a new browser tab/window', 'wpas'), 'id' => 'social_newtab', 'std' => '0', 'type' => 'checkbox');
    $options[] = array('name' => esc_html__('Twitter', 'wpas'), 'desc' => esc_html__('Enter your Twitter URL.', 'wpas'), 'id' => 'social_twitter', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Facebook', 'wpas'), 'desc' => esc_html__('Enter your Facebook URL.', 'wpas'), 'id' => 'social_facebook', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Google+', 'wpas'), 'desc' => esc_html__('Enter your Google+ URL.', 'wpas'), 'id' => 'social_googleplus', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('LinkedIn', 'wpas'), 'desc' => esc_html__('Enter your LinkedIn URL.', 'wpas'), 'id' => 'social_linkedin', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('SlideShare', 'wpas'), 'desc' => esc_html__('Enter your SlideShare URL.', 'wpas'), 'id' => 'social_slideshare', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Dribbble', 'wpas'), 'desc' => esc_html__('Enter your Dribbble URL.', 'wpas'), 'id' => 'social_dribbble', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Tumblr', 'wpas'), 'desc' => esc_html__('Enter your Tumblr URL.', 'wpas'), 'id' => 'social_tumblr', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('GitHub', 'wpas'), 'desc' => esc_html__('Enter your GitHub URL.', 'wpas'), 'id' => 'social_github', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Bitbucket', 'wpas'), 'desc' => esc_html__('Enter your Bitbucket URL.', 'wpas'), 'id' => 'social_bitbucket', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Foursquare', 'wpas'), 'desc' => esc_html__('Enter your Foursquare URL.', 'wpas'), 'id' => 'social_foursquare', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('YouTube', 'wpas'), 'desc' => esc_html__('Enter your YouTube URL.', 'wpas'), 'id' => 'social_youtube', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Instagram', 'wpas'), 'desc' => esc_html__('Enter your Instagram URL.', 'wpas'), 'id' => 'social_instagram', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Flickr', 'wpas'), 'desc' => esc_html__('Enter your Flickr URL.', 'wpas'), 'id' => 'social_flickr', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Pinterest', 'wpas'), 'desc' => esc_html__('Enter your Pinterest URL.', 'wpas'), 'id' => 'social_pinterest', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('RSS', 'wpas'), 'desc' => esc_html__('Enter your RSS Feed URL.', 'wpas'), 'id' => 'social_rss', 'std' => '', 'type' => 'text');
    $options[] = array('name' => esc_html__('Advanced settings', 'wpas'), 'type' => 'heading');
    $options[] = array('name' => esc_html__('Banner Background', 'wpas'), 'desc' => esc_html__('Select an image and background color for the homepage banner.', 'wpas'), 'id' => 'banner_background', 'std' => $background_defaults, 'type' => 'background');
    $options[] = array('name' => esc_html__('Footer Background Color', 'wpas'), 'desc' => esc_html__('Select the background color for the footer.', 'wpas'), 'id' => 'footer_color', 'std' => '#222222', 'type' => 'color');
    $options[] = array('name' => esc_html__('Footer Content', 'wpas'), 'desc' => esc_html__('Enter the text you&lsquo;d like to display in the footer. This content will be displayed just below the footer widgets. It&lsquo;s ideal for displaying your copyright message or credits.', 'wpas'), 'id' => 'footer_content', 'std' => wpas_get_credits(), 'type' => 'editor', 'settings' => $wp_editor_settings);
    $options[] = array('name' => esc_html__('Footer Content Position', 'wpas'), 'desc' => esc_html__('Select what position you would like the footer content aligned to.', 'wpas'), 'id' => 'footer_position', 'std' => 'center', 'type' => 'select', 'class' => 'mini', 'options' => $footer_position_settings);
    if (wpas_is_woocommerce_active()) {
        $options[] = array('name' => esc_html__('WooCommerce settings', 'wpas'), 'type' => 'heading');
        $options[] = array('name' => esc_html__('Shop sidebar', 'wpas'), 'desc' => esc_html__('Display the sidebar on the WooCommerce Shop page', 'wpas'), 'id' => 'woocommerce_shopsidebar', 'std' => '1', 'type' => 'checkbox');
        $options[] = array('name' => esc_html__('Products sidebar', 'wpas'), 'desc' => esc_html__('Display the sidebar on the WooCommerce Single Product page', 'wpas'), 'id' => 'woocommerce_productsidebar', 'std' => '1', 'type' => 'checkbox');
        $options[] = array('name' => esc_html__('Cart, Checkout & My Account sidebars', 'wpas'), 'desc' => esc_html__('The &lsquo;Cart&rsquo;, &lsquo;Checkout&rsquo; and &lsquo;My Account&rsquo; pages are displayed using shortcodes. To remove the sidebar from these Pages, simply edit each Page and change the Template (in the Page Attributes Panel) to the &lsquo;Full-width Page Template&rsquo;.', 'wpas'), 'type' => 'info');
        $options[] = array('name' => esc_html__('Shop Breadcrumbs', 'wpas'), 'desc' => esc_html__('Display the breadcrumbs on the WooCommerce pages', 'wpas'), 'id' => 'woocommerce_breadcrumbs', 'std' => '1', 'type' => 'checkbox');
        $options[] = array('name' => esc_html__('Shop Products', 'wpas'), 'desc' => esc_html__('Select the number of products to display on the shop page.', 'wpas'), 'id' => 'shop_products', 'std' => '12', 'type' => 'select', 'class' => 'mini', 'options' => $shop_products_settings);
    }
    return $options;
}
コード例 #2
0
 function wpas_setup_woocommerce_wrappers()
 {
     if (wpas_is_woocommerce_active() && is_woocommerce()) {
         add_action('wpas_before_woocommerce', 'wpas_before_woocommerce_wrapper', 10, 0);
         add_action('wpas_after_woocommerce', 'wpas_after_woocommerce_wrapper', 10, 0);
     }
 }