本文整理汇总了PHP中woo_metaboxes_add函数的典型用法代码示例。如果您正苦于以下问题:PHP woo_metaboxes_add函数的具体用法?PHP woo_metaboxes_add怎么用?PHP woo_metaboxes_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woo_metaboxes_add函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: woo_options
function woo_options()
{
// THEME VARIABLES
$themename = "Travelllll";
$themeslug = "travelllll";
// Woo Metabox Options
// Start name with underscore to hide custom key from the user
$woo_metaboxes = array();
global $post;
if (get_post_type() == 'post' || !get_post_type()) {
$woo_metaboxes[] = array("name" => "general_heading", "label" => "General Options", "type" => "info", "desc" => "");
$woo_metaboxes[] = array("name" => "source_name", "label" => "Source Name", "type" => "text", "desc" => "Enter the name of the source of this story. Keep this as short as possible.");
$woo_metaboxes[] = array("name" => "source_url", "label" => "Source URL", "type" => "text", "desc" => "Enter the URL of the source of this story.");
$woo_metaboxes[] = array("name" => "video_heading", "label" => "Video Options", "type" => "info", "desc" => "");
$woo_metaboxes[] = array("name" => "embed", "std" => "", "label" => "Video Embed", "type" => "textarea", "desc" => "Enter the video embed code for your video (YouTube, Vimeo or similar). Embed size attributes don't matter - any size will work.");
$woo_metaboxes[] = array("name" => "featured_heading", "label" => "Featured Options", "type" => "info", "desc" => "");
$woo_metaboxes[] = array("name" => "image", "label" => "Slider Image", "type" => "upload", "desc" => "Upload an image or enter an URL. This is ONLY for manually promoted stories on the homepage. 978x180");
$woo_metaboxes[] = array("name" => "sponsored_heading", "label" => "Sponsored Options", "type" => "info", "desc" => "");
$woo_metaboxes[] = array("name" => "sponsored_image", "label" => "Sponsored Image", "type" => "upload", "desc" => "Upload an image of the sponsor logo. The image will be resized to fit into a 220x180 box.");
$woo_metaboxes[] = array("name" => "sponsored_text", "std" => "", "label" => "Sponsored Caption", "type" => "textarea", "desc" => "Enter the agreed caption for this sponsor. No more than 2 links please.");
$woo_metaboxes[] = array("name" => "sponsored_background", "label" => "Sponsored Background", "type" => "upload", "desc" => "If applicable, upload a featured background image for this post. Must be at least 1280px wide.");
$woo_metaboxes[] = array("name" => "sponsored_background_padding", "label" => "Sponsored BG Padding", "type" => "text", "desc" => "Optionally, enter a custom value for vertical padding space in px. Eg: 350. Default is 250px.");
$woo_metaboxes[] = array("name" => "sponsored_background_color", "label" => "Sponsored BG Color", "type" => "text", "desc" => "Optionally, enter a custom hex value for background colour. Eg: 000000. Default is white.");
}
// End post
// Add extra metaboxes through function
if (function_exists("woo_metaboxes_add")) {
$woo_metaboxes = woo_metaboxes_add($woo_metaboxes);
}
if (get_option('woo_custom_template') != $woo_metaboxes) {
update_option('woo_custom_template', $woo_metaboxes);
}
}
开发者ID:digideskio,项目名称:Travelllll,代码行数:33,代码来源:theme-options.php
示例2: woo_options
//.........这里部分代码省略.........
$options[] = array("name" => "Auto Start", "desc" => "Set the slider to start sliding automatically.", "id" => $shortname . "_slider_auto", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Auto Slide Interval", "desc" => "The time in <b>seconds</b> each slide pauses for, before sliding to the next.", "id" => $shortname . "_slider_interval", "std" => "6", "type" => "select", "options" => array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'));
$options[] = array("name" => "Featured Slider Title", "desc" => "Show the post title in slider.", "id" => $shortname . "_slider_title", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Featured Slider Content", "desc" => "Show the post content in slider.", "id" => $shortname . "_slider_content", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Next/Previous", "desc" => "Select to display next/previous buttons.", "id" => $shortname . "_slider_nextprev", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Pagination", "desc" => "Select to display pagination.", "id" => $shortname . "_slider_pagination", "std" => "true", "type" => "checkbox");
/* Dynamic Images */
$options[] = array("name" => "Dynamic Images", "type" => "heading", "icon" => "image");
$options[] = array("name" => 'Dynamic Image Resizing', "desc" => "", "id" => $shortname . "_wpthumb_notice", "std" => 'There are two alternative methods of dynamically resizing the thumbnails in the theme, <strong>WP Post Thumbnail</strong> or <strong>TimThumb - Custom Settings panel</strong>. We recommend using WP Post Thumbnail option.', "type" => "info");
$options[] = array("name" => "WP Post Thumbnail", "desc" => "Use WordPress post thumbnail to assign a post thumbnail. Will enable the <strong>Featured Image panel</strong> in your post sidebar where you can assign a post thumbnail.", "id" => $shortname . "_post_image_support", "std" => "true", "class" => "collapsed", "type" => "checkbox");
$options[] = array("name" => "WP Post Thumbnail - Dynamic Image Resizing", "desc" => "The post thumbnail will be dynamically resized using native WP resize functionality. <em>(Requires PHP 5.2+)</em>", "id" => $shortname . "_pis_resize", "std" => "true", "class" => "hidden", "type" => "checkbox");
$options[] = array("name" => "WP Post Thumbnail - Hard Crop", "desc" => "The post thumbnail will be cropped to match the target aspect ratio (only used if 'Dynamic Image Resizing' is enabled).", "id" => $shortname . "_pis_hard_crop", "std" => "true", "class" => "hidden last", "type" => "checkbox");
$options[] = array("name" => "TimThumb - Custom Settings Panel", "desc" => "This will enable the <a href='http://code.google.com/p/timthumb/'>TimThumb</a> (thumb.php) script which dynamically resizes images added through the <strong>custom settings panel below the post</strong>. Make sure your themes <em>cache</em> folder is writable. <a href='http://www.woothemes.com/2008/10/troubleshooting-image-resizer-thumbphp/'>Need help?</a>", "id" => $shortname . "_resize", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Automatic Image Thumbnail", "desc" => "If no thumbnail is specifified then the first uploaded image in the post is used.", "id" => $shortname . "_auto_img", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Thumbnail Image Dimensions", "desc" => "Enter an integer value i.e. 250 for the desired size which will be used when dynamically creating the images.", "id" => $shortname . "_image_dimensions", "std" => "", "type" => array(array('id' => $shortname . '_thumb_w', 'type' => 'text', 'std' => 100, 'meta' => 'Width'), array('id' => $shortname . '_thumb_h', 'type' => 'text', 'std' => 100, 'meta' => 'Height')));
$options[] = array("name" => "Thumbnail Image alignment", "desc" => "Select how to align your thumbnails with posts.", "id" => $shortname . "_thumb_align", "std" => "alignleft", "type" => "radio", "options" => array("alignleft" => "Left", "alignright" => "Right", "aligncenter" => "Center"));
$options[] = array("name" => "Show thumbnail in Single Posts", "desc" => "Show the attached image in the single post page.", "id" => $shortname . "_thumb_single", "class" => "collapsed", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Single Image Dimensions", "desc" => "Enter an integer value i.e. 250 for the image size. Max width is 600.", "id" => $shortname . "_image_dimensions", "std" => "", "class" => "hidden last", "type" => array(array('id' => $shortname . '_single_w', 'type' => 'text', 'std' => 150, 'meta' => 'Width'), array('id' => $shortname . '_single_h', 'type' => 'text', 'std' => 150, 'meta' => 'Height')));
$options[] = array("name" => "Single Post Image alignment", "desc" => "Select how to align your thumbnail with single posts.", "id" => $shortname . "_thumb_single_align", "std" => "alignright", "type" => "radio", "class" => "hidden", "options" => array("alignleft" => "Left", "alignright" => "Right", "aligncenter" => "Center"));
$options[] = array("name" => "Add thumbnail to RSS feed", "desc" => "Add the the image uploaded via your Custom Settings to your RSS feed", "id" => $shortname . "_rss_thumb", "std" => "false", "type" => "checkbox");
/* Footer */
$options[] = array("name" => "Footer Customization", "type" => "heading", "icon" => "footer");
$url = get_bloginfo('template_url') . '/functions/images/';
$options[] = array("name" => "Footer Widget Areas", "desc" => "Select how many footer widget areas you want to display.", "id" => $shortname . "_footer_sidebars", "std" => "4", "type" => "images", "options" => array('0' => $url . 'layout-off.png', '1' => $url . 'footer-widgets-1.png', '2' => $url . 'footer-widgets-2.png', '3' => $url . 'footer-widgets-3.png', '4' => $url . 'footer-widgets-4.png'));
$options[] = array("name" => "Custom Affiliate Link", "desc" => "Add an affiliate link to the WooThemes logo in the footer of the theme.", "id" => $shortname . "_footer_aff_link", "std" => "", "type" => "text");
$options[] = array("name" => "Enable Custom Footer (Left)", "desc" => "Activate to add the custom text below to the theme footer.", "id" => $shortname . "_footer_left", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Custom Text (Left)", "desc" => "Custom HTML and Text that will appear in the footer of your theme.", "id" => $shortname . "_footer_left_text", "std" => "", "type" => "textarea");
$options[] = array("name" => "Enable Custom Footer (Right)", "desc" => "Activate to add the custom text below to the theme footer.", "id" => $shortname . "_footer_right", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Custom Text (Right)", "desc" => "Custom HTML and Text that will appear in the footer of your theme.", "id" => $shortname . "_footer_right_text", "std" => "", "type" => "textarea");
// Upload Video Page Template
$options[] = array("name" => "Upload Video", "icon" => "upload", "id" => $shortname . "_upload_listing_heading", "type" => "heading");
$options[] = array("name" => "Only Register Users may post a Video", "desc" => "This forces users to register before being able to add a video.", "id" => $shortname . "_upload_user_logged_in", "std" => "false", "type" => "checkbox");
/* Subscribe & Connect */
$options[] = array("name" => "Subscribe & Connect", "type" => "heading", "icon" => "connect");
$options[] = array("name" => "Enable Subscribe & Connect - Single Post", "desc" => "Enable the subscribe & connect area on single posts. You can also add this as a <a href='" . home_url() . "/wp-admin/widgets.php'>widget</a> in your sidebar.", "id" => $shortname . "_connect", "std" => 'false', "type" => "checkbox");
$options[] = array("name" => "Subscribe Title", "desc" => "Enter the title to show in your subscribe & connect area.", "id" => $shortname . "_connect_title", "std" => '', "type" => "text");
$options[] = array("name" => "Text", "desc" => "Change the default text in this area.", "id" => $shortname . "_connect_content", "std" => '', "type" => "textarea");
$options[] = array("name" => "Subscribe By E-mail ID (Feedburner)", "desc" => "Enter your <a href='http://www.google.com/support/feedburner/bin/answer.py?hl=en&answer=78982'>Feedburner ID</a> for the e-mail subscription form.", "id" => $shortname . "_connect_newsletter_id", "std" => '', "type" => "text");
$options[] = array("name" => 'Subscribe By E-mail to MailChimp', 'woothemes', "desc" => 'If you have a MailChimp account you can enter the <a href="http://woochimp.heroku.com" target="_blank">MailChimp List Subscribe URL</a> to allow your users to subscribe to a MailChimp List.', "id" => $shortname . "_connect_mailchimp_list_url", "std" => '', "type" => "text");
$options[] = array("name" => "Enable RSS", "desc" => "Enable the subscribe and RSS icon.", "id" => $shortname . "_connect_rss", "std" => 'true', "type" => "checkbox");
$options[] = array("name" => "Twitter URL", "desc" => "Enter your <a href='http://www.twitter.com/'>Twitter</a> URL e.g. http://www.twitter.com/woothemes", "id" => $shortname . "_connect_twitter", "std" => '', "type" => "text");
$options[] = array("name" => "Facebook URL", "desc" => "Enter your <a href='http://www.facebook.com/'>Facebook</a> URL e.g. http://www.facebook.com/woothemes", "id" => $shortname . "_connect_facebook", "std" => '', "type" => "text");
$options[] = array("name" => "YouTube URL", "desc" => "Enter your <a href='http://www.youtube.com/'>YouTube</a> URL e.g. http://www.youtube.com/woothemes", "id" => $shortname . "_connect_youtube", "std" => '', "type" => "text");
$options[] = array("name" => "Flickr URL", "desc" => "Enter your <a href='http://www.flickr.com/'>Flickr</a> URL e.g. http://www.flickr.com/woothemes", "id" => $shortname . "_connect_flickr", "std" => '', "type" => "text");
$options[] = array("name" => "LinkedIn URL", "desc" => "Enter your <a href='http://www.www.linkedin.com.com/'>LinkedIn</a> URL e.g. http://www.linkedin.com/in/woothemes", "id" => $shortname . "_connect_linkedin", "std" => '', "type" => "text");
$options[] = array("name" => "Delicious URL", "desc" => "Enter your <a href='http://www.delicious.com/'>Delicious</a> URL e.g. http://www.delicious.com/woothemes", "id" => $shortname . "_connect_delicious", "std" => '', "type" => "text");
$options[] = array("name" => "Google+ URL", "desc" => "Enter your <a href='http://plus.google.com/'>Google+</a> URL e.g. https://plus.google.com/104560124403688998123/", "id" => $shortname . "_connect_googleplus", "std" => '', "type" => "text");
$options[] = array("name" => "Enable Related Posts", "desc" => "Enable related posts in the subscribe area. Uses posts with the same <strong>tags</strong> to find related posts. Note: Will not show in the Subscribe widget.", "id" => $shortname . "_connect_related", "std" => 'true', "type" => "checkbox");
/* Advertising */
$options[] = array("name" => "Video Ad (234x60)", "icon" => "ads", "type" => "heading");
$options[] = array("name" => "Enable Ad", "desc" => "Enable the ad space in the featured video area.", "id" => $shortname . "_ad_panel", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Adsense code", "desc" => "Enter your adsense code (or other ad network code) here.", "id" => $shortname . "_ad_panel_adsense", "std" => "", "type" => "textarea");
$options[] = array("name" => "Image Location", "desc" => "Enter the URL to the banner ad image location.", "id" => $shortname . "_ad_panel_image", "std" => "http://www.woothemes.com/ads/234x60a.jpg", "type" => "upload");
$options[] = array("name" => "Destination URL", "desc" => "Enter the URL where this banner ad points to.", "id" => $shortname . "_ad_panel_url", "std" => "http://www.woothemes.com", "type" => "text");
// Add extra options through function
if (function_exists("woo_options_add")) {
$options = woo_options_add($options);
}
if (get_option('woo_template') != $options) {
update_option('woo_template', $options);
}
if (get_option('woo_themename') != $themename) {
update_option('woo_themename', $themename);
}
if (get_option('woo_shortname') != $shortname) {
update_option('woo_shortname', $shortname);
}
if (get_option('woo_manual') != $manualurl) {
update_option('woo_manual', $manualurl);
}
// Woo Metabox Options
// Start name with underscore to hide custom key from the user
$woo_metaboxes = array();
global $post;
if (get_post_type() == 'post' || !get_post_type()) {
$woo_metaboxes[] = array("name" => "image", "label" => "Image", "type" => "upload", "desc" => "Upload an image or enter an URL.");
if (get_option('woo_resize') == "true") {
$woo_metaboxes[] = array("name" => "_image_alignment", "std" => "Center", "label" => "Image Crop Alignment", "type" => "select2", "desc" => "Select crop alignment for resized image", "options" => array("c" => "Center", "t" => "Top", "b" => "Bottom", "l" => "Left", "r" => "Right"));
}
}
// End post
// Fields for `woo_video` Custom Post Type.
if (get_post_type() == 'woo_video' || !get_post_type()) {
$woo_metaboxes[] = array("name" => "image", "label" => "Image", "type" => "upload", "desc" => "Upload an image or enter an URL.");
$woo_metaboxes[] = array("name" => "embed", "std" => "", "label" => "Embed Code", "type" => "textarea", "desc" => "Enter the video embed code for your video (YouTube, Vimeo or similar)");
$woo_metaboxes[] = array("name" => "slider_output", "label" => "Slider Output", "desc" => "Select what to display in the slider.", "std" => "image", "type" => "radio", "options" => array("image" => "Image", "video" => "Video"));
$woo_metaboxes[] = array("name" => "slide_layout", "label" => "Slider Overlay Layout", "desc" => "Specify where you want the slider overlay content to display", "std" => "left", "type" => "radio", "options" => array("left" => __("Left Aligned", "woothemes"), "right" => __("Right Aligned", "woothemes"), "top" => __("Top Aligned", "woothemes"), "bottom" => __("Bottom Aligned", "woothemes")));
$woo_metaboxes[] = array("name" => "uploader_name", "label" => "Uploader Name", "desc" => "Your full name.", "id" => $shortname . "_uploader_name", "std" => '', "type" => "text");
$woo_metaboxes[] = array("name" => "uploader_email", "label" => "Uploader E-mail Address", "desc" => "Your e-mail address.", "id" => $shortname . "_uploader_email", "std" => '', "type" => "text");
}
// End IF Statement
$woo_metaboxes[] = array("name" => "_layout", "std" => "normal", "label" => "Page Layout", "type" => "images", "desc" => "Select the layout you want on this specific post/page.", "options" => array('layout-default' => $url . 'layout-off.png', 'layout-full' => get_bloginfo('template_url') . '/functions/images/' . '1c.png', 'layout-left-content' => get_bloginfo('template_url') . '/functions/images/' . '2cl.png', 'layout-right-content' => get_bloginfo('template_url') . '/functions/images/' . '2cr.png'));
// Add extra metaboxes through function
if (function_exists("woo_metaboxes_add")) {
$woo_metaboxes = woo_metaboxes_add($woo_metaboxes);
}
if (get_option('woo_custom_template') != $woo_metaboxes) {
update_option('woo_custom_template', $woo_metaboxes);
}
}
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:101,代码来源:theme-options.php
示例3: woo_options
//.........这里部分代码省略.........
$options[] = array("name" => "Link Hover Color", "desc" => "Pick a custom color for links hover or add a hex color code e.g. #697e09", "id" => "woo_link_hover_color", "std" => "", "type" => "color");
$options[] = array("name" => "Button Color", "desc" => "Pick a custom color for buttons or add a hex color code e.g. #697e09", "id" => "woo_button_color", "std" => "", "type" => "color");
$options[] = array("name" => "Home - Featured", "icon" => "featured", "type" => "heading");
$options[] = array("name" => "Disable Featured Area", "desc" => "Check this if you don't want to use the featured area.", "id" => $shortname . "_featured_disable", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Featured Image Bottom Margin", "desc" => "Enter a custom bottom margin for the featured image e.g -65 or 20", "id" => $shortname . "_featured_image_margin", "std" => "-65", "type" => "text");
$options[] = array("name" => "Featured Fade Speed", "desc" => "Enter a time in milliseconds for the fade transition e.g. 500", "id" => $shortname . "_featured_speed", "std" => "500", "type" => "text");
$options[] = array("name" => "Featured Timeout", "desc" => "Enter a time in milliseconds to wait between page transitions e.g. 6000. Set to 0 to disable auto fade.", "id" => $shortname . "_featured_timeout", "std" => "6000", "type" => "text");
$options[] = array("name" => "Featured Auto Resize", "desc" => "Enable automatic resizing of the featured area with animation to fit the featured page content.", "id" => $shortname . "_featured_resize", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Custom Height", "desc" => "Change the default featured height from 325px to your own preferred height. <strong>Example: '300'</strong>.", "id" => $shortname . "_featured_height", "std" => "", "type" => "text");
$options[] = array("name" => "Home - Main Area", "icon" => "homepage", "type" => "heading");
$options[] = array("name" => "Mini-Features Area", "desc" => "Enable the front page Mini-Features features area.", "id" => $shortname . "_main_pages", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Mini-Features More Link URL", "desc" => "Enter a URL for the more features link under mini-features.", "id" => $shortname . "_main_pages_link", "std" => "", "type" => "text");
$options[] = array("name" => "Mini-Features More Link Text", "desc" => "Enter a text for the more features link under mini-features.", "id" => $shortname . "_main_pages_link_text", "std" => "View all features", "type" => "text");
$options[] = array("name" => "Custom permalink", "desc" => "This option allows you to change the permalink on the individual mini-features pages. (e.g /infobox/pagename to /features/pagename/). Please update <a href='" . admin_url('options-permalink.php') . "'>Permalinks</a> after any changes.", "id" => $shortname . "_infobox_rewrite", "std" => "infobox", "type" => "text");
$options[] = array("name" => "Homepage content #1", "desc" => "(Optional) Select a page that you'd like to display on the front page <strong>above the mini features area</strong>.", "id" => $shortname . "_main_page1", "std" => "Select a page:", "type" => "select", "options" => $woo_pages);
$options[] = array("name" => "Homepage content #2", "desc" => "(Optional) Select a page that you'd like to display on the front page <strong>below the mini features area.</strong>", "id" => $shortname . "_main_page2", "std" => "Select a page:", "type" => "select", "options" => $woo_pages);
$options[] = array("name" => "Portfolio", "icon" => "portfolio", "type" => "heading");
$options[] = array("name" => "Use Lightbox?", "desc" => "Show the portfolio URL or large image in a javascript lightbox.", "id" => $shortname . "_portfolio_lightbox", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Use Dynamic Image Resizer?", "desc" => "Use the dynamic image resizer (thumb.php) to resize the portfolio thumbnail. Remember to CHMOD your cache folder to 777. <a href='http://www.woothemes.com/2008/10/troubleshooting-image-resizer-thumbphp/'>Need help?</a>", "id" => $shortname . "_portfolio_resize", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Portfolio Tags", "desc" => "Enter comma seperated tags for portfolio sorting (e.g. web, print, icons). You must add these tags to the portfolio items you want to sort.", "id" => $shortname . "_portfolio_tags", "std" => "", "type" => "text");
$options[] = array("name" => "Layout Options", "icon" => "layout", "type" => "heading");
$options[] = array("name" => "Show Breadcrumbs bar?", "desc" => "Check this box if you'd like to show breadcrumbs at the top of your pages, posts and archives. <a href='http://yoast.com/wordpress/breadcrumbs/'>Yoast Breadcrumbs Plugin</a> is supported in the breadcrumbs bar.", "id" => $shortname . "_breadcrumbs", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Blog Excerpt", "desc" => "Show only the excerpt in the blog section. ", "id" => $shortname . "_excerpt", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Dynamic Images", "type" => "heading", "icon" => "image");
$options[] = array("name" => "Enable WordPress Post Thumbnail Support", "desc" => "Use WordPress post thumbnail support to assign a post thumbnail.", "id" => $shortname . "_post_image_support", "std" => "true", "class" => "collapsed", "type" => "checkbox");
$options[] = array("name" => "Dynamically Resize Post Thumbnail", "desc" => "The post thumbnail will be dynamically resized using native WP resize functionality. <em>(Requires PHP 5.2+)</em>", "id" => $shortname . "_pis_resize", "std" => "true", "class" => "hidden", "type" => "checkbox");
$options[] = array("name" => "Hard Crop Post Thumbnail", "desc" => "The image will be cropped to match the target aspect ratio.", "id" => $shortname . "_pis_hard_crop", "std" => "true", "class" => "hidden last", "type" => "checkbox");
$options[] = array("name" => "Enable Dynamic Image Resizer", "desc" => "This will enable the thumb.php script which dynamically resizes images on your site.", "id" => $shortname . "_resize", "std" => "true", "type" => "checkbox");
$options[] = array("name" => "Automatic Image Thumbs", "desc" => "If no image is specified in the 'image' custom field then the first uploaded post image is used.", "id" => $shortname . "_auto_img", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Thumbnail Image Dimensions", "desc" => "Enter an integer value i.e. 250 for the desired size which will be used when dynamically creating the images.", "id" => $shortname . "_image_dimensions", "std" => "", "type" => array(array('id' => $shortname . '_thumb_w', 'type' => 'text', 'std' => 100, 'meta' => 'Width'), array('id' => $shortname . '_thumb_h', 'type' => 'text', 'std' => 100, 'meta' => 'Height')));
$options[] = array("name" => "Thumbnail Image alignment", "desc" => "Select how to align your thumbnails with posts.", "id" => $shortname . "_thumb_align", "std" => "alignleft", "type" => "radio", "options" => $options_thumb_align);
$options[] = array("name" => "Show thumbnail in Single Posts", "desc" => "Show the attached image in the single post page.", "id" => $shortname . "_thumb_single", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Single Image Dimensions", "desc" => "Enter an integer value i.e. 250 for the image size. Max width is 576.", "id" => $shortname . "_image_dimensions", "std" => "", "type" => array(array('id' => $shortname . '_single_w', 'type' => 'text', 'std' => 200, 'meta' => 'Width'), array('id' => $shortname . '_single_h', 'type' => 'text', 'std' => 200, 'meta' => 'Height')));
$options[] = array("name" => "Add thumbnail to RSS feed", "desc" => "Add the the image uploaded via your Custom Settings to your RSS feed", "id" => $shortname . "_rss_thumb", "std" => "false", "type" => "checkbox");
//Footer
$options[] = array("name" => "Footer Customization", "icon" => "footer", "type" => "heading");
$options[] = array("name" => "Custom Affiliate Link", "desc" => "Add an affiliate link to the WooThemes logo in the footer of the theme.", "id" => $shortname . "_footer_aff_link", "std" => "", "type" => "text");
$options[] = array("name" => "Enable Custom Footer (Left)", "desc" => "Activate to add the custom text below to the theme footer.", "id" => $shortname . "_footer_left", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Custom Text (Left)", "desc" => "Custom HTML and Text that will appear in the footer of your theme.", "id" => $shortname . "_footer_left_text", "std" => "<p></p>", "type" => "textarea");
$options[] = array("name" => "Enable Custom Footer (Right)", "desc" => "Activate to add the custom text below to the theme footer.", "id" => $shortname . "_footer_right", "std" => "false", "type" => "checkbox");
$options[] = array("name" => "Custom Text (Right)", "desc" => "Custom HTML and Text that will appear in the footer of your theme.", "id" => $shortname . "_footer_right_text", "std" => "<p></p>", "type" => "textarea");
// Add extra options through function
if (function_exists("woo_options_add")) {
$options = woo_options_add($options);
}
// Add extra options through function
if (function_exists("woo_options_add")) {
$options = woo_options_add($options);
}
if (get_option('woo_template') != $options) {
update_option('woo_template', $options);
}
if (get_option('woo_themename') != $themename) {
update_option('woo_themename', $themename);
}
if (get_option('woo_shortname') != $shortname) {
update_option('woo_shortname', $shortname);
}
if (get_option('woo_manual') != $manualurl) {
update_option('woo_manual', $manualurl);
}
// Woo Metabox Options
$woo_metaboxes = array();
if (get_post_type() == 'post' || !get_post_type()) {
$woo_metaboxes[] = array("name" => "image", "label" => "Image", "type" => "upload", "desc" => "Upload image for use with blog posts");
}
// End post
if (get_post_type() == 'slide' || !get_post_type()) {
$woo_metaboxes["slide_image"] = array("name" => "slide_image", "label" => "Slider Image", "type" => "upload", "desc" => "Upload image for use in the featured area on the homepage");
$woo_metaboxes["slide_url"] = array("name" => "slide_url", "label" => "Slider Link out", "type" => "text", "desc" => "Enter a custom URL for the featured image on homepage");
$woo_metaboxes["slide_embed"] = array("name" => "slide_embed", "label" => "Slider Embed Code", "type" => "textarea", "desc" => "Enter a video embed code to use in featured area.");
}
// End slide
if (get_post_type() == 'infobox' || !get_post_type()) {
$woo_metaboxes['mini'] = array("name" => "mini", "label" => "Mini-features Icon", "type" => "upload", "desc" => "Upload icon for use with the Mini-Feature on the homepage (optimal size: 32x32px) (optional)");
$woo_metaboxes['mini_excerpt'] = array("name" => "mini_excerpt", "label" => "Mini-features Excerpt", "type" => "textarea", "desc" => "Enter the text to show in your Mini-Feature. ");
$woo_metaboxes['mini_readmore'] = array("name" => "mini_readmore", "std" => "", "label" => "Mini-features URL", "type" => "text", "desc" => "Add an URL for your Read More button in your Mini-Feature on homepage (optional)");
}
// End mini
if (get_post_type() == 'portfolio' || !get_post_type()) {
$woo_metaboxes['portfolio'] = array("name" => "portfolio", "label" => "Portfolio Thumbnail", "type" => "upload", "desc" => "Upload an image for use in the portfolio (optimal size: 450x210)");
$woo_metaboxes['portfolio-large'] = array("name" => "portfolio-large", "label" => "Portfolio Large", "type" => "upload", "desc" => "Add an URL OR upload an image for use as the large portfolio image");
}
// End portfolio
if (get_post_type() == 'feedback' || !get_post_type()) {
$woo_metaboxes['feedback_citation'] = array("name" => "feedback_citation", "label" => "Citation", "type" => "text", "desc" => "Enter a citation for this feedback post.");
}
// End portfolio
// Add extra metaboxes through function
if (function_exists("woo_metaboxes_add")) {
$woo_metaboxes = woo_metaboxes_add($woo_metaboxes);
}
// Add extra metaboxes through function
if (function_exists("woo_metaboxes_add")) {
$woo_metaboxes = woo_metaboxes_add($woo_metaboxes);
}
if (get_option('woo_custom_template') != $woo_metaboxes) {
update_option('woo_custom_template', $woo_metaboxes);
}
}
开发者ID:aozora,项目名称:arashi,代码行数:101,代码来源:theme-options.php
示例4: woo_options
function woo_options()
{
// VARIABLES
$themename = "BlogTheme";
$manualurl = 'http://www.woothemes.com/support/theme-documentation/blogtheme/';
$shortname = "woo";
$GLOBALS['template_path'] = get_bloginfo('template_directory');
//Access the WordPress Categories via an Array
$woo_categories = array();
$woo_categories_obj = get_categories('hide_empty=0');
foreach ($woo_categories_obj as $woo_cat) {
$woo_categories[$woo_cat->cat_ID] = $woo_cat->cat_name;
}
$categories_tmp = array_unshift($woo_categories, "Select a category:");
//Access the WordPress Pages via an Array
$woo_pages = array();
$woo_pages_obj = get_pages('sort_column=post_parent,menu_order');
foreach ($woo_pages_obj as $woo_page) {
$woo_pages[$woo_page->ID] = $woo_page->post_name;
}
$woo_pages_tmp = array_unshift($woo_pages, "Select a page:");
//Stylesheets Reader
$alt_stylesheet_path = TEMPLATEPATH . '/styles/';
$alt_stylesheets = array();
if (is_dir($alt_stylesheet_path)) {
if ($alt_stylesheet_dir = opendir($alt_stylesheet_path)) {
while (($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false) {
if (stristr($alt_stylesheet_file, ".css") !== false) {
$alt_stylesheets[] = $alt_stylesheet_file;
}
}
}
}
//More Options
$other_entries = array("Select a number:", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19");
// THIS IS THE DIFFERENT FIELDS
$options = array();
// THIS IS THE DIFFERENT FIELDS
$options[] = array("name" => "General Settings", "icon" => "general", "type" => "heading");
$options[] = array("name" => "Theme Stylesheet", "desc" => "Select your themes alternative color scheme.", "id" => $shortname . "_alt_stylesheet", "std" => "default.css", "type" => "select", "options" => $alt_stylesheets);
$options[] = array("name" => "Custom Logo", "desc" => "Upload a logo for your theme, or specify an image URL directly.", "id" => $shortname . "_logo", "std" => "", "type" => "upload");
$options[] = array("name" => "Custom Favicon", "desc" => "Upload a 16px x 16px <a href='http://www.faviconr.com/'>ico image</a> that will represent your website's favicon.", "id" => $shortname . "_custom_favicon", "std" => "", "type" => "upload");
$options[] = array("name" => "Tracking Code", "desc" => "Paste your Google Analytics (or other) tracking code here. This will be added into the footer template of your theme.", "id" => $shortname . "_google_analytics", "std" => "", "type" => "textarea");
$options[] = array("name" => "RSS URL", "desc" => "Enter your preferred RSS URL. (Feedburner or other)", "id" => $shortname . "_feedburner_url", "std" => "", "type" => "text");
$options[] = array("name" => "Custom CSS", "desc" => "Quickly add some CSS to your theme by adding it to this block.", "id" => $shortname . "_custom_css", "std" => "", "type" => "textarea");
$options[] = array("name" => "Twitter Username", "desc" => "Enter your Twitter Username here.", "id" => $shortname . "_twitter", "std" => "", "type" => "text");
$options[] = array("name" => "Layout Options", "icon" => "layout", "type" => "heading");
$options[] = array("name" => "Exclude pages from menu", "desc" => "Enter a comma-separated list of the <a href'http://faq.wordpress.com/2008/05/29/how-to-find-page-id-numbers/'>page ID's</a> that you'd like to exclude from the main top navigation. (ie. 1,2,3,4)", "id" => $shortname . "_menupages", "std" => "", "type" => "text");
$options[] = array("name" => "Display Full Post or Excerpt?", "desc" => "If checked, the homepage will display the full post content. If unchecked it will display the excerpt only.", "id" => $shortname . "_the_content", "std" => "false", "type" => "checkbox");
// Add extra options through function
if (function_exists("woo_options_add")) {
$options = woo_options_add($options);
}
if (get_option('woo_template') != $options) {
update_option('woo_template', $options);
}
if (get_option('woo_themename') != $themename) {
update_option('woo_themename', $themename);
}
if (get_option('woo_shortname') != $shortname) {
update_option('woo_shortname', $shortname);
}
if (get_option('woo_manual') != $manualurl) {
update_option('woo_manual', $manualurl);
}
// Woo Metabox Options
$woo_metaboxes = array("page-description" => array("name" => "page-description", "default" => "", "label" => "Page Description", "type" => "text"));
// Add extra metaboxes through function
if (function_exists("woo_metaboxes_add")) {
$woo_metaboxes = woo_metaboxes_add($woo_metaboxes);
}
if (get_option('woo_custom_template') != $woo_metaboxes) {
update_option('woo_custom_template', $woo_metaboxes);
}
/*
function woo_update_options(){
$options = get_option('woo_template',$options);
foreach ($options as $option){
update_option($option['id'],$option['std']);
}
}
function woo_add_options(){
$options = get_option('woo_template',$options);
foreach ($options as $option){
update_option($option['id'],$option['std']);
}
}
//add_action('switch_theme', 'woo_update_options');
if(get_option('template') == 'wooframework'){
woo_add_options();
} // end function
*/
}
开发者ID:rosshettel,项目名称:Northern-Star-Blogs,代码行数:96,代码来源:theme-options.php
示例5: woo_options
//.........这里部分代码省略.........
$options[] = array('name' => __('Single Post - Show Thumbnail', 'woothemes'), 'desc' => __('Show the thumbnail in the single post page.', 'woothemes'), 'id' => $shortname . '_thumb_single', 'class' => 'collapsed', 'std' => 'false', 'type' => 'checkbox');
$options[] = array('name' => __('Single Post - Thumbnail Dimensions', 'woothemes'), 'desc' => __('Enter an integer value i.e. 250 for the image size. Max width is 576.', 'woothemes'), 'id' => $shortname . '_image_dimensions', 'std' => '', 'class' => 'hidden last', 'type' => array(array('id' => $shortname . '_single_w', 'type' => 'text', 'std' => 200, 'meta' => __('Width', 'woothemes')), array('id' => $shortname . '_single_h', 'type' => 'text', 'std' => 200, 'meta' => __('Height', 'woothemes'))));
$options[] = array('name' => __('Single Post - Thumbnail Alignment', 'woothemes'), 'desc' => __('Select how to align your thumbnail with single posts.', 'woothemes'), 'id' => $shortname . '_thumb_single_align', 'std' => 'alignright', 'type' => 'select2', 'class' => 'hidden', 'options' => array('alignleft' => __('Left', 'woothemes'), 'alignright' => __('Right', 'woothemes'), 'aligncenter' => __('Center', 'woothemes')));
$options[] = array('name' => __('Add thumbnail to RSS feed', 'woothemes'), 'desc' => __('Add the the image uploaded via your Custom Settings panel to your RSS feed', 'woothemes'), 'id' => $shortname . '_rss_thumb', 'std' => 'false', 'type' => 'checkbox');
$options[] = array('name' => __('Enable Lightbox', 'woothemes'), 'desc' => __('Enable the PrettyPhoto lighbox script on images within your website\'s content.', 'woothemes'), 'id' => $shortname . '_enable_lightbox', 'std' => 'false', 'type' => 'checkbox');
/* Footer */
$options[] = array('name' => __('Footer Customization', 'woothemes'), 'type' => 'heading', 'icon' => 'footer');
$url = get_template_directory_uri() . '/functions/images/';
$options[] = array('name' => __('Footer Widget Areas', 'woothemes'), 'desc' => __('Select how many footer widget areas you want to display.', 'woothemes'), 'id' => $shortname . '_footer_sidebars', 'std' => '4', 'type' => 'images', 'options' => array('0' => $url . 'layout-off.png', '1' => $url . 'footer-widgets-1.png', '2' => $url . 'footer-widgets-2.png', '3' => $url . 'footer-widgets-3.png', '4' => $url . 'footer-widgets-4.png'));
$options[] = array('name' => __('Custom Affiliate Link', 'woothemes'), 'desc' => __('Add an affiliate link to the WooThemes logo in the footer of the theme.', 'woothemes'), 'id' => $shortname . '_footer_aff_link', 'std' => '', 'type' => 'text');
$options[] = array('name' => __('Enable Custom Footer (Left)', 'woothemes'), 'desc' => __('Activate to add the custom text below to the theme footer.', 'woothemes'), 'id' => $shortname . '_footer_left', 'std' => 'false', 'type' => 'checkbox');
$options[] = array('name' => __('Custom Text (Left)', 'woothemes'), 'desc' => __('Custom HTML and Text that will appear in the footer of your theme.', 'woothemes'), 'id' => $shortname . '_footer_left_text', 'std' => '', 'type' => 'textarea');
$options[] = array('name' => __('Enable Custom Footer (Right)', 'woothemes'), 'desc' => __('Activate to add the custom text below to the theme footer.', 'woothemes'), 'id' => $shortname . '_footer_right', 'std' => 'false', 'type' => 'checkbox');
$options[] = array('name' => __('Custom Text (Right)', 'woothemes'), 'desc' => __('Custom HTML and Text that will appear in the footer of your theme.', 'woothemes'), 'id' => $shortname . '_footer_right_text', 'std' => '', 'type' => 'textarea');
/* Subscribe & Connect */
$options[] = array('name' => __('Subscribe & Connect', 'woothemes'), 'type' => 'heading', 'icon' => 'conn
|
请发表评论