コード例 #1
0
<?php

$general_tab = array("name" => "general", "title" => __("General", "agency"), 'sections' => array('general' => array('name' => 'general', 'title' => __('General', 'agency'), 'description' => __('Settings related to the entire theme.', 'agency')), 'contact' => array('name' => 'contact', 'title' => __('Contact', 'agency'), 'description' => __('Settings related to the contact info.', 'agency')), 'carousel' => array('name' => 'carousel', 'title' => __('Homepage Image Carousel', 'agency'), 'description' => __('Settings related to the homepage image carousel.', 'agency'))));
$social_media_tab = array("name" => "social-media", "title" => __("Social Media", "agency"), 'sections' => array('social' => array('name' => 'social', 'title' => __('Social Media', 'agency'), 'description' => __('Your social media settings', 'agency')), 'social-footer' => array('name' => 'social-footer', 'title' => __('Social Footer', 'agency'), 'description' => __('Which social media link in footer', 'agency'))));
$options = array('highlight_color' => array('tab' => "general", "name" => "highlight_color", "title" => "Link & Highlight Color", 'description' => __('Enter the highlight color you\'d like to use for links & other theme highlights.', 'agency'), 'section' => 'general', 'since' => '1.0', "id" => "general", "type" => "color", "default" => "7CBBBF"), 'link_color_hover' => array('tab' => "general", "name" => "link_color_hover", "title" => "Link Hover Color", 'description' => __('Enter the color you\'d like to have for link hover effects.', 'agency'), 'section' => 'general', 'since' => '1.0', "id" => "general", "type" => "color", "default" => "468B8F"), 'copyright_text' => array('tab' => "general", "name" => "copyright_text", "title" => "Copyright Text", 'description' => __('Enter the text you\'d like to have in the footer, below the footer nav.', 'agency'), 'section' => 'general', 'since' => '1.0', "id" => "general", "type" => "text", "default" => "Copyright " . date('Y') . " UpThemes.com. All Rights Reserved."), 'agency_email' => array('tab' => "general", "name" => "agency_email", "title" => "Email for contact template", 'description' => __('Enter an email', 'agency'), 'section' => 'contact', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'address_text1' => array('tab' => "general", "name" => "address_text1", "title" => "Address - Street", 'description' => __('Enter your Street Address', 'agency'), 'section' => 'contact', 'since' => '1.0', "id" => "general", "type" => "text", "default" => "555 Main St., Suite 100"), 'address_text2' => array('tab' => "general", "name" => "address_text2", "title" => "Address - City, State, Zip", 'description' => __('Enter your City, State, Zip', 'agency'), 'section' => 'contact', 'since' => '1.0', "id" => "general", "type" => "text", "default" => "San Diego, CA 55555-5454"), 'phone_text' => array('tab' => "general", "name" => "phone_text", "title" => "Footer Phone", 'description' => __('Enter the number you\'d like to have in the footer.', 'agency'), 'section' => 'contact', 'since' => '1.0', "id" => "general", "type" => "text", "default" => "555-555-5555"), 'email_text' => array('tab' => "general", "name" => "email_text", "title" => "Footer Email", 'description' => __('Enter the email you\'d like to have in the footer.', 'agency'), 'section' => 'contact', 'since' => '1.0', "id" => "general", "type" => "text", "default" => "*****@*****.**"), 'twitter_user' => array('tab' => "social-media", "name" => "twitter_user", "title" => "Twitter Username", 'description' => __('Enter your twitter username', 'agency'), 'section' => 'social', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'vimeo_user' => array('tab' => "social-media", "name" => "vimeo_user", "title" => "Vimeo URL Number (i.e.&nbsp;'user12345')", 'description' => __('Enter the vimeo user number (e.g. \'user12345\')', 'agency'), 'section' => 'social', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'linkedin_user' => array('tab' => "social-media", "name" => "linkedin_user", "title" => "LinkedIn Username", 'description' => __('Enter your linkedin public profile link', 'agency'), 'section' => 'social', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'dribbble_user' => array('tab' => "social-media", "name" => "dribbble_user", "title" => "Dribbble Username", 'description' => __('Enter your dribbble username', 'agency'), 'section' => 'social', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'facebook_user' => array('tab' => "social-media", "name" => "facebook_user", "title" => "Facebook Username", 'description' => __('Enter your facebook username', 'agency'), 'section' => 'social', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'flickr_user' => array('tab' => "social-media", "name" => "flickr_user", "title" => "Flickr Username", 'description' => __('Enter your flickr username', 'agency'), 'section' => 'social', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'forrst_user' => array('tab' => "social-media", "name" => "forrst_user", "title" => "Forrst Username", 'description' => __('Enter your forrst username', 'agency'), 'section' => 'social', 'since' => '1.0', "id" => "general", "type" => "text", "default" => ""), 'social_footer_select' => array('tab' => "social-media", "name" => "social_footer_select", "title" => "Social Media Footer Select", 'description' => __('Which social media link do you want in your footer?', 'agency'), 'section' => 'social-footer', 'since' => '1.0', "id" => "social-footer", "type" => "select", "default" => "twitter", "valid_options" => array('Twitter' => array("name" => "twitter", "title" => __('Twitter', 'agency')), 'LinkedIn' => array("name" => "linkedin", "title" => __('LinkedIn', 'agency')), 'Facebook' => array("name" => "facebook", "title" => __('Facebook', 'agency')), 'Dribbble' => array("name" => "dribbble", "title" => __('Dribbble', 'agency')), 'Vimeo' => array("name" => "vimeo", "title" => __('Vimeo', 'agency')), 'Flickr' => array("name" => "flickr", "title" => __('Flickr', 'agency')), 'Forrst' => array("name" => "forrst", "title" => __('Forst', 'agency')))), 'enable_carousel_text' => array('tab' => "general", "name" => "enable_carousel_text", "title" => "Enable text for carousel", 'description' => __('Allows you to enable text overlay on top of images in homepage carousel.', 'agency'), 'section' => 'carousel', 'since' => '1.0', "id" => "carousel", "type" => "select", "default" => "false", "valid_options" => array('true' => array("name" => "true", "title" => __('Yes', 'agency')), 'false' => array("name" => "false", "title" => __('No', 'agency')))));
register_theme_option_tab($general_tab);
register_theme_option_tab($social_media_tab);
register_theme_options($options);
コード例 #2
0
ファイル: theme-options.php プロジェクト: audiblePi/fccTest
<?php

/* Theme Options page: */
$main_tab = array("name" => "main_options", "title" => __("Theme Options"), 'sections' => array('header' => array('name' => 'main', 'title' => __(''), 'description' => __(''))));
register_theme_option_tab($main_tab);
$mainoptions = array("site_logo" => array("tab" => "main_options", "name" => "site_logo", "title" => "Site Logo", "description" => __("Upload logo to be used in header"), "section" => "main", "id" => "site_logo", "type" => "image"), "home_page_slider_image1" => array("tab" => "main_options", "name" => "home_page_slider_image1", "title" => "Slider Image 1", "description" => __("Upload logo to be used in header", "example"), "section" => "main", "id" => "slider_image_1", "type" => "image"), "home_page_slider_image2" => array("tab" => "main_options", "name" => "home_page_slider_image2", "title" => "Slider Image 2", "description" => __("Upload logo to be used in header", "example"), "section" => "main", "id" => "slider_image_2", "type" => "image"), "home_page_slider_image3" => array("tab" => "main_options", "name" => "home_page_slider_image3", "title" => "Slider Image 3", "description" => __("Upload logo to be used in header", "example"), "section" => "main", "id" => "slider_image_3", "type" => "image"), "office_location" => array("tab" => "main_options", "name" => "office_location", "title" => "Office Location", "description" => __("Enter office location which will be used for displaying on Google Map for site."), "section" => "main", "id" => "office_location", "type" => "text"));
register_theme_options($mainoptions);
コード例 #3
0
 * - key	type	string	(required)	option type; one of: text, color, image, select, multiple, textarea, page, pages, category, categories
 * - key	value	string	(required)	default option value, replaced when custom value is entered (text, color, select, textarea, page, category)
 * - key	options	array	(optional)	associative array of valid options for select-type options, in the form of "Name" => "slug"
 * - key	attr	array	(optional)	form-field attributes
 * - keys	url		string	(optional)	default-image URL, for image-type options
 * 
 * @package 	Micro
 * @copyright	Copyright (c) 2011, UpThemes
 * @license		http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
 *
 * @since 		Micro 1.0
 */
$thistab = array("name" => "colors_and_images", "title" => __("Colors and Images", "upfw"), 'sections' => array('color_scheme' => array('name' => 'color_scheme', 'title' => __('Color Scheme', 'upfw'), 'description' => __('Select your color scheme.', 'upfw'))));
$options = array('theme_color_scheme' => array('tab' => $thistab['name'], "name" => "theme_color_scheme", "title" => "Theme Color Scheme", 'description' => __('Display header navigation menu above or below the site title/description?', 'oenology'), 'section' => 'color_scheme', 'since' => '1.0', "id" => "color_scheme", "type" => "select", "default" => "light", "valid_options" => array('light' => array("name" => "light", "title" => __('Light', 'storefrontal')), 'dark' => array("name" => "dark", "title" => __('Dark', 'storefrontal')))));
register_theme_options($options);
register_theme_option_tab($thistab);
/*        
array(  "name" => "Default Hyperlink Color",
        "desc" => "Enter a default hyperlink color here.",
        "id" => "default_link_color",
        "type" => "color"),
        
array(  "name" => "Hover Hyperlink Color",
        "desc" => "Enter a hover hyperlink color here.",
        "id" => "hover_link_color",
        "type" => "color"),
        
array(  "name" => "Active Hyperlink Color",
        "desc" => "Enter an active hyperlink color here.",
        "id" => "active_link_color",
        "type" => "color"),