Ticket #7657: 7657.r8969.diff
File 7657.r8969.diff, 5.4 KB (added by , 16 years ago) |
---|
-
theme.php
71 71 /** 72 72 * Retrieve localized stylesheet URI. 73 73 * 74 * {@internal Missing Long Description}} 74 * The stylesheet directory for the localized stylesheet files are located, by 75 * default, in the base theme directory. The name of the locale file will be the 76 * locale followed by '.css'. If that does not exist, then the text direction 77 * stylesheet will be checked for existence, for example 'ltr.css'. 75 78 * 79 * The theme may change the location of the stylesheet directory by either using 80 * the 'stylesheet_directory_uri' filter or the 'locale_stylesheet_uri' filter. 81 * If you want to change the location of the stylesheet files for the entire 82 * WordPress workflow, then change the former. If you just have the locale in a 83 * separate folder, then change the latter. 84 * 76 85 * @since 2.1.0 77 86 * @uses apply_filters() Calls 'locale_stylesheet_uri' filter on stylesheet URI path and stylesheet directory URI. 78 87 * … … 135 144 /** 136 145 * Retrieve theme data from parsed theme file. 137 146 * 138 * {@internal Missing Long Description}} 147 * The description will have the tags filtered with the following HTML elements 148 * whitelisted. The <b>'a'</b> element with the <em>href</em> and <em>title</em> 149 * attributes. The <b>abbr</b> element with the <em>title</em> attribute. The 150 * <b>acronym<b> element with the <em>title</em> attribute allowed. The 151 * <b>code</b>, <b>em</b>, and <b>strong</b> elements also allowed. 139 152 * 153 * The style.css file must contain theme name, theme URI, and description. The 154 * data can also contain author URI, author, template (parent template), 155 * version, status, and finally tags. Some of these are not used by WordPress 156 * administration panels, but are used by theme directory web sites which list 157 * the theme. 158 * 140 159 * @since 1.5.0 141 160 * 142 161 * @param string $theme_file Theme file path. … … 209 228 /** 210 229 * Retrieve list of themes with theme data in theme directory. 211 230 * 212 * {@internal Missing Long Description}} 231 * The theme is broken, if it doesn't have a parent theme and is missing either 232 * style.css and, or index.php. If the theme has a parent theme then it is 233 * broken, if it is missing style.css; index.php is optional. The broken theme 234 * list is saved in the {@link $wp_broken_themes} global, which is displayed on 235 * the theme list in the administration panels. 213 236 * 214 237 * @since 1.5.0 238 * @global array $wp_broken_themes Stores the broken themes. 239 * @global array $wp_themes Stores the working themes. 215 240 * 216 241 * @return array Theme list with theme data. 217 242 */ … … 574 599 return apply_filters('tag_template', $template); 575 600 } 576 601 602 /** 603 * Retrieve path of taxonomy template in current or parent template. 604 * 605 * Retrieves the taxonomy and term, if term is available. The template is 606 * prepended with 'taxonomy-' and followed by both the taxonomy string and 607 * the taxonomy string followed by a dash and then followed by the term. 608 * 609 * The taxonomy and term template is checked and used first, if it exists. 610 * Second, just the taxonomy template is checked, and then finally, taxonomy.php 611 * template is used. If none of the files exist, then it will fall back on to 612 * index.php. 613 * 614 * @since unknown (2.6.0 most likely) 615 * @uses apply_filters() Calls 'taxonomy_template' filter on found path. 616 * 617 * @return string 618 */ 577 619 function get_taxonomy_template() { 578 620 $taxonomy = get_query_var('taxonomy'); 579 621 $term = get_query_var('term'); … … 672 714 * 673 715 * @since 1.5.0 674 716 * 675 * @return unknown717 * @return string 676 718 */ 677 719 function get_single_template() { 678 720 return get_query_template('single'); … … 793 835 } 794 836 795 837 /** 796 * {@internal Missing Short Description}}838 * Start preview theme output buffer. 797 839 * 798 * {@internal Missing Long Description}} 840 * Will only preform task if the user has permissions and template and preview 841 * query variables exist. 799 842 * 800 843 * @since 2.5.0 801 *802 * @param unknown_type $template803 * @param unknown_type $stylesheet804 844 */ 805 845 function preview_theme() { 806 846 if ( ! (isset($_GET['template']) && isset($_GET['preview'])) ) … … 827 867 } 828 868 add_action('setup_theme', 'preview_theme'); 829 869 870 /** 871 * Callback function for ob_start() to capture all links in the theme. 872 * 873 * @since unknown 874 * @access private 875 * 876 * @param string $content 877 * @return string 878 */ 830 879 function preview_theme_ob_filter( $content ) { 831 880 return preg_replace_callback( "|(<a.*?href=([\"']))(.*?)([\"'].*?>)|", 'preview_theme_ob_filter_callback', $content ); 832 881 } 833 882 883 /** 884 * Manipulates preview theme links in order to control and maintain location. 885 * 886 * Callback function for preg_replace_callback() to accept and filter matches. 887 * 888 * @since unknown 889 * @access private 890 * 891 * @param array $matches 892 * @return string 893 */ 834 894 function preview_theme_ob_filter_callback( $matches ) { 835 895 if ( 836 896 ( false !== strpos($matches[3], '/wp-admin/') ) … … 849 909 return $matches[1] . attribute_escape( $link ) . $matches[4]; 850 910 } 851 911 912 /** 913 * Switches current theme to new template and stylesheet names. 914 * 915 * @since unknown 916 * @uses do_action() Calls 'switch_theme' action on updated theme display name. 917 * 918 * @param string $template Template name 919 * @param string $stylesheet Stylesheet name. 920 */ 852 921 function switch_theme($template, $stylesheet) { 853 922 update_option('template', $template); 854 923 update_option('stylesheet', $stylesheet);