Make WordPress Core


Ignore:
Timestamp:
03/08/2012 06:18:10 PM (15 years ago)
Author:
nacin
Message:

Pass WP_Theme->get_theme_root_uri() to get_theme_root_uri(), thereby always triggering the theme_root_uri filter. see #20103.

File:
1 edited

Legend:

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

    r20148 r20162  
    112112         */
    113113        private $parent;
     114
     115        /**
     116         * URL to the theme root, usually an absolute URL to wp-content/themes
     117         *
     118         * @access private
     119         * var string
     120         */
     121        private $theme_root_uri;
    114122
    115123        /**
    … …  
    790798         * Returns the URL to the directory of the theme root.
    791799         *
    792          * This is typically the absolute path to wp-content/themes.
     800         * This is typically the absolute URL to wp-content/themes. This forms the basis
     801         * for all other URLs returned by WP_Theme, so we pass it to the public function
     802         * get_theme_root_uri() and allow it to run the theme_root_uri filter.
     803         *
     804         * @uses get_theme_root_uri()
    793805         *
    794806         * @since 3.4.0
    … …  
    798810         */
    799811        public function get_theme_root_uri() {
    800                 if ( 0 === strpos( WP_CONTENT_DIR, $this->theme_root ) )
    801                         return str_replace( WP_CONTENT_DIR, content_url(), $this->theme_root );
    802                 // Give up, send it off to the filter.
    803                 return get_theme_root_uri( $this->stylesheet );
     812                if ( ! isset( $this->theme_root_uri ) )
     813                        $this->theme_root_uri = get_theme_root_uri( $this->stylesheet, $this->theme_root );
     814                return $this->theme_root_uri;
    804815        }
    805816
Note: See TracChangeset for help on using the changeset viewer.