Make WordPress Core

Changeset 8974


Ignore:
Timestamp:
09/25/2008 02:12:58 PM (16 years ago)
Author:
azaozz
Message:

Complete inline documentation for theme.php, props jacobsantos, fixes #7657

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r8965 r8974  
    7272 * Retrieve localized stylesheet URI.
    7373 *
    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'.
     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.
    7584 *
    7685 * @since 2.1.0
     
    136145 * Retrieve theme data from parsed theme file.
    137146 *
    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.
     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.
    139158 *
    140159 * @since 1.5.0
     
    210229 * Retrieve list of themes with theme data in theme directory.
    211230 *
    212  * {@internal Missing Long Description}}
    213  *
    214  * @since 1.5.0
     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.
     236 *
     237 * @since 1.5.0
     238 * @global array $wp_broken_themes Stores the broken themes.
     239 * @global array $wp_themes Stores the working themes.
    215240 *
    216241 * @return array Theme list with theme data.
     
    575600}
    576601
     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 */
    577619function get_taxonomy_template() {
    578620    $taxonomy = get_query_var('taxonomy');
     
    673715 * @since 1.5.0
    674716 *
    675  * @return unknown
     717 * @return string
    676718 */
    677719function get_single_template() {
     
    794836
    795837/**
    796  * {@internal Missing Short Description}}
    797  *
    798  * {@internal Missing Long Description}}
     838 * Start preview theme output buffer.
     839 *
     840 * Will only preform task if the user has permissions and template and preview
     841 * query variables exist.
    799842 *
    800843 * @since 2.5.0
    801  *
    802  * @param unknown_type $template
    803  * @param unknown_type $stylesheet
    804844 */
    805845function preview_theme() {
     
    828868add_action('setup_theme', 'preview_theme');
    829869
     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 */
    830879function preview_theme_ob_filter( $content ) {
    831880    return preg_replace_callback( "|(<a.*?href=([\"']))(.*?)([\"'].*?>)|", 'preview_theme_ob_filter_callback', $content );
    832881}
    833882
     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 */
    834894function preview_theme_ob_filter_callback( $matches ) {
    835895    if (
     
    850910}
    851911
     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 */
    852921function switch_theme($template, $stylesheet) {
    853922    update_option('template', $template);
Note: See TracChangeset for help on using the changeset viewer.