• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP woo_options_add函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中woo_options_add函数的典型用法代码示例。如果您正苦于以下问题:PHP woo_options_add函数的具体用法?PHP woo_options_add怎么用?PHP woo_options_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了woo_options_add函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: woo_options


//.........这里部分代码省略.........
     $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 Alignment", "desc" => "Select how to align your thumbnails with posts.", "id" => $shortname . "_thumb_align", "std" => "alignleft", "type" => "select2", "options" => array("alignleft" => "Left", "alignright" => "Right", "aligncenter" => "Center"));
     $options[] = array("name" => "Single Post - Show Thumbnail", "desc" => "Show the thumbnail in the single post page.", "id" => $shortname . "_thumb_single", "class" => "collapsed", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => "Single Post - Thumbnail Dimensions", "desc" => "Enter an integer value i.e. 250 for the image size. Max width is 576.", "id" => $shortname . "_image_dimensions", "std" => "", "class" => "hidden last", "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" => "Single Post - Thumbnail Alignment", "desc" => "Select how to align your thumbnail with single posts.", "id" => $shortname . "_thumb_single_align", "std" => "alignright", "type" => "select2", "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 panel to your RSS feed", "id" => $shortname . "_rss_thumb", "std" => "false", "type" => "checkbox");
     /* Footer */
     $options[] = array("name" => "Footer Customization", "type" => "heading", "icon" => "footer");
     $url = get_template_directory_uri() . '/functions/images/';
     $options[] = array("name" => "Footer Widget Areas", "desc" => "Select how many footer widget areas you want to display.", "id" => $shortname . "_footer_sidebars", "std" => "3", "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");
     /* 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" => "Top Ad (468x60px)",
     //					"type" => "heading",
     //					"icon" => "ads" );
     //$options[] = array( "name" => "Enable Ad",
     //					"desc" => "Enable the ad space",
     //					"id" => $shortname."_ad_top",
     //					"std" => "false",
     //					"type" => "checkbox" );
     //$options[] = array( "name" => "Adsense code",
     //					"desc" => "Enter your adsense code (or other ad network code) here.",
     //					"id" => $shortname."_ad_top_adsense",
     //					"std" => "",
     //					"type" => "textarea" );
     //$options[] = array( "name" => "Image Location",
     //					"desc" => "Enter the URL to the banner ad image location.",
     //					"id" => $shortname."_ad_top_image",
     //					"std" => "http://www.woothemes.com/ads/468x60b.jpg",
     //					"type" => "upload" );
     //$options[] = array( "name" => "Destination URL",
     //					"desc" => "Enter the URL where this banner ad points to.",
     //					"id" => $shortname."_ad_top_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"));
         }
         $woo_metaboxes[] = array("name" => "embed", "std" => "", "label" => "Embed Code", "type" => "textarea", "desc" => "Enter the video embed code for your video (YouTube, Vimeo or similar)");
     }
     // End post
     $woo_metaboxes[] = array("name" => "_layout", "std" => "normal", "label" => "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_template_directory_uri() . '/functions/images/' . '1c.png', 'layout-left-content' => get_template_directory_uri() . '/functions/images/' . '2cl.png', 'layout-right-content' => get_template_directory_uri() . '/functions/images/' . '2cr.png'));
     if (get_post_type() == 'slide' || !get_post_type()) {
         $woo_metaboxes[] = array("name" => "image", "label" => "Image", "type" => "upload", "desc" => "Upload an image or enter an URL.");
         $woo_metaboxes[] = array("name" => "slide_layout", "label" => "Slider Overlay Layout", "desc" => "Specify where you want the slider overlay content to display", "std" => "right", "type" => "select2", "options" => array("left" => "Left", "right" => "Right", "top" => "Top", "bottom" => "Bottom"));
         $woo_metaboxes[] = array("name" => "slide-url", "label" => "Slide URL", "type" => "text", "desc" => "Enter a URL for the slide to click through to.");
     }
     // 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:ericvyc,项目名称:mtp,代码行数:101,代码来源: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" => __('Flickr URL', 'woothemes'), "desc" => __('Enter your  <a href="http://www.flickr.com/">Flickr</a> URL e.g. http://www.flickr.com/woothemes', 'woothemes'), "id" => $shortname . "_connect_flickr", "std" => '', "type" => "text");
     $options[] = array("name" => __('LinkedIn URL', 'woothemes'), "desc" => __('Enter your  <a href="http://www.www.linkedin.com.com/">LinkedIn</a> URL e.g. http://www.linkedin.com/in/woothemes', 'woothemes'), "id" => $shortname . "_connect_linkedin", "std" => '', "type" => "text");
     $options[] = array("name" => __('Delicious URL', 'woothemes'), "desc" => __('Enter your <a href="http://www.delicious.com/">Delicious</a> URL e.g. http://www.delicious.com/woothemes', 'woothemes'), "id" => $shortname . "_connect_delicious", "std" => '', "type" => "text");
     $options[] = array("name" => __('Google+ URL', 'woothemes'), "desc" => __('Enter your <a href="http://plus.google.com/">Google+</a> URL e.g. https://plus.google.com/104560124403688998123/', 'woothemes'), "id" => $shortname . "_connect_googleplus", "std" => '', "type" => "text");
     $options[] = array('name' => __('Dribbble', 'woothemes'), 'desc' => sprintf(__('Enter your %1$s URL e.g. http://dribbble.com/woothemes', 'woothemes'), '<a href="http://dribbble.com/">' . __('Dribbble', 'woothemes') . '</a>'), 'id' => $shortname . '_connect_dribbble', 'std' => '', 'type' => 'text');
     $options[] = array('name' => __('Instagram', 'woothemes'), 'desc' => sprintf(__('Enter your %1$s URL e.g. http://instagram.com/woothemes', 'woothemes'), '<a href="http://instagram.com">' . __('Instagram', 'woothemes') . '</a>'), 'id' => $shortname . '_connect_instagram', 'std' => '', 'type' => 'text');
     $options[] = array('name' => __('Vimeo', 'woothemes'), 'desc' => sprintf(__('Enter your %1$s URL e.g. http://vimeo.com/woothemes', 'woothemes'), '<a href="http://vimeo.com/">' . __('Vimeo', 'woothemes') . '</a>'), 'id' => $shortname . '_connect_vimeo', 'std' => '', 'type' => 'text');
     $options[] = array('name' => __('Pinterest', 'woothemes'), 'desc' => sprintf(__('Enter your %1$s URL e.g. http://pinterest.com/woothemes', 'woothemes'), '<a href="http://pinterest.com/">' . __('Pinterest', 'woothemes') . '</a>'), 'id' => $shortname . '_connect_pinterest', 'std' => '', 'type' => 'text');
     /* Contact Template Settings */
     $options[] = array('name' => __('Contact Page', 'woothemes'), 'icon' => 'maps', 'type' => 'heading');
     $options[] = array('name' => __('Contact Information', 'woothemes'), 'type' => 'subheading');
     $options[] = array("name" => __('Contact Information Panel', 'woothemes'), "desc" => __('Enable the contact information panel on your contact page template.', 'woothemes'), "id" => $shortname . "_contact_panel", "std" => "false", "class" => 'collapsed', "type" => "checkbox");
     $options[] = array('name' => __('Location Name', 'woothemes'), 'desc' => __('Enter the location name. Example: London Office', 'woothemes'), 'id' => $shortname . '_contact_title', 'std' => '', 'class' => 'hidden', 'type' => 'text');
     $options[] = array('name' => __('Location Address', 'woothemes'), 'desc' => __('Enter your company\'s address', 'woothemes'), 'id' => $shortname . '_contact_address', 'std' => '', 'class' => 'hidden', 'type' => "textarea");
     $options[] = array('name' => __('Telephone', 'woothemes'), 'desc' => __('Enter your telephone number', 'woothemes'), 'id' => $shortname . '_contact_number', 'std' => '', 'class' => 'hidden', 'type' => 'text');
     $options[] = array('name' => __('Fax', 'woothemes'), 'desc' => __('Enter your fax number', 'woothemes'), 'id' => $shortname . '_contact_fax', 'std' => '', 'class' => 'hidden last', 'type' => 'text');
     $options[] = array("name" => __('Contact Form E-Mail', 'woothemes'), "desc" => __('Enter your E-mail address to use on the "Contact Form" page Template.', 'woothemes'), "id" => $shortname . "_contactform_email", "std" => "", "type" => "text");
     $options[] = array("name" => __('Enable Subscribe and Connect', 'woothemes'), "desc" => __('Enable the subscribe and connect functionality on the contact page template', 'woothemes'), "id" => $shortname . "_contact_subscribe_and_connect", "std" => "false", "type" => "checkbox");
     $options[] = array('name' => __('Maps', 'woothemes'), 'type' => 'subheading');
     $options[] = array('name' => __('Contact Form Google Maps Coordinates', 'woothemes'), 'desc' => sprintf(__('Enter your Google Map coordinates to display a map on the Contact Form page template. You can get these details from %sGoogle Maps%s', 'woothemes'), '<a href="' . esc_url('http://itouchmap.com/latlong.html') . '" target="_blank">', '</a>'), 'id' => $shortname . '_contactform_map_coords', 'std' => '', 'type' => 'text');
     $options[] = array('name' => __('Disable Mousescroll', 'woothemes'), 'desc' => __('Turn off the mouse scroll action for all the Google Maps on the site. This could improve usability on your site.', 'woothemes'), 'id' => $shortname . '_maps_scroll', 'std' => '', 'type' => 'checkbox');
     $options[] = array('name' => __('Map Height', 'woothemes'), 'desc' => __('Height in pixels for the maps displayed on Single.php pages.', 'woothemes'), 'id' => $shortname . '_maps_single_height', 'std' => "250", 'type' => 'text');
     $options[] = array('name' => __('Default Map Zoom Level', 'woothemes'), 'desc' => __('Set this to adjust the default in the post & page edit backend.', 'woothemes'), 'id' => $shortname . '_maps_default_mapzoom', 'std' => "9", 'type' => 'select2', 'options' => $other_entries);
     $options[] = array('name' => __('Default Map Type', 'woothemes'), 'desc' => __('Set this to the default rendered in the post backend.', 'woothemes'), 'id' => $shortname . '_maps_default_maptype', 'std' => 'G_NORMAL_MAP', 'type' => 'select2', 'options' => array('G_NORMAL_MAP' => __('Normal', 'woothemes'), 'G_SATELLITE_MAP' => __('Satellite', 'woothemes'), 'G_HYBRID_MAP' => __('Hybrid', 'woothemes'), 'G_PHYSICAL_MAP' => __('Terrain', 'woothemes')));
     $options[] = array('name' => __('Map Callout Text', 'woothemes'), 'desc' => __('Text or HTML that will be output when you click on the map marker for your location.', 'woothemes'), 'id' => $shortname . '_maps_callout_text', 'std' => "", 'type' => 'textarea');
     /* Projects */
     if (class_exists('Projects')) {
         $options[] = array('name' => __('Projects', 'woothemes'), 'type' => 'heading');
         $options[] = array("name" => __('Enable Old Portfolio Look', 'woothemes'), "desc" => __('This alternative design resembles the old Portfolio layout.', 'woothemes'), "id" => $shortname . "_projects_old_look", "std" => "false", "type" => "checkbox");
         $options[] = array("name" => __('Galleries Page Layout', 'woothemes'), "desc" => __('Select main content and sidebar alignment. Choose between 1, 2 or 3 column layout.', 'woothemes'), "id" => $shortname . "_projects_layout", "std" => "two-col-left", "type" => "images", "options" => array('one-col' => $images_dir . '1c.png', 'two-col-left' => $images_dir . '2cl.png', 'two-col-right' => $images_dir . '2cr.png', 'three-col-left' => $images_dir . '3cl.png', 'three-col-middle' => $images_dir . '3cm.png', 'three-col-right' => $images_dir . '3cr.png'));
         $options[] = array("name" => __('Single Project Layout', 'woothemes'), "desc" => __('Select main content and sidebar alignment. Choose between 1, 2 or 3 column layout.', 'woothemes'), "id" => $shortname . "_projects_layout_single", "std" => "two-col-left", "type" => "images", "options" => array('one-col' => $images_dir . '1c.png', 'two-col-left' => $images_dir . '2cl.png', 'two-col-right' => $images_dir . '2cr.png', 'three-col-left' => $images_dir . '3cl.png', 'three-col-middle' => $images_dir . '3cm.png', 'three-col-right' => $images_dir . '3cr.png'));
     }
     // 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()) {
         // TimThumb is enabled in options
         if (get_option('woo_resize') == 'true') {
             $woo_metaboxes[] = array('name' => 'image', 'label' => __('Image', 'woothemes'), 'type' => 'upload', 'desc' => __('Upload an image or enter an URL.', 'woothemes'));
             $woo_metaboxes[] = array('name' => '_image_alignment', 'std' => __('Center', 'woothemes'), 'label' => __('Image Crop Alignment', 'woothemes'), 'type' => 'select2', 'desc' => __('Select crop alignment for resized image', 'woothemes'), 'options' => array('c' => 'Center', 't' => 'Top', 'b' => 'Bottom', 'l' => 'Left', 'r' => 'Right'));
         }
         $url = get_template_directory_uri() . '/functions/images/';
         $woo_metaboxes[] = array("name" => "layout", "label" => __('Layout', 'woothemes'), "type" => "images", "desc" => __('Select a specific layout for this post/page. Overrides default site layout.', 'woothemes'), "options" => array('' => $url . 'layout-off.png', 'one-col' => $url . '1c.png', 'two-col-left' => $url . '2cl.png', 'two-col-right' => $url . '2cr.png', 'three-col-left' => $url . '3cl.png', 'three-col-middle' => $url . '3cm.png', 'three-col-right' => $url . '3cr.png'));
         $woo_metaboxes[] = array("name" => "embed", "label" => __('Embed', 'woothemes'), "type" => "textarea", "desc" => __('Enter embed code for use on single posts and with the Video widget.', 'woothemes'));
         if (get_option('woo_woo_tumblog_switch') == 'true') {
             $woo_metaboxes[] = array("name" => "video-embed", "label" => __('Tumblog : Embed Code (Videos)', 'woothemes'), "type" => "textarea", "desc" => __('Add embed code for video services like Youtube or Vimeo - Tumblog only.', 'woothemes'));
             $woo_metaboxes[] = array("name" => "quote-author", "std" => "Unknown", "label" => __('Tumblog : Quote Author', 'woothemes'), "type" => "text", "desc" => __('Enter the name of the Quote Author.', 'woothemes'));
             $woo_metaboxes[] = array("name" => "quote-url", "std" => "http://", "label" => __('Tumblog : Link to Quote', 'woothemes'), "type" => "text", "desc" => __('Enter the url/web address of the Quote if available.', 'woothemes'));
             $woo_metaboxes[] = array("name" => "quote-copy", "std" => "Unknown", "label" => __('Tumblog : Quote', 'woothemes'), "type" => "textarea", "desc" => __('Enter the Quote.', 'woothemes'));
             $woo_metaboxes[] = array("name" => "audio", "std" => "http://", "label" => __('Tumblog : Audio URL', 'woothemes'), "type" => "text", "desc" => __('Enter the url/web address of the Audio file.', 'woothemes'));
             $woo_metaboxes[] = array("name" => "link-url", "std" => "http://", "label" => __('Tumblog : Link URL', 'woothemes'), "type" => "text", "desc" => __('Enter the url/web address of the Link.', 'woothemes'));
开发者ID:smoobs,项目名称:marcus,代码行数:67,代码来源: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 . &q 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP woo_pagenav函数代码示例发布时间:2022-05-23
下一篇:
PHP woo_metaboxes_add函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap