Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move hybrid_get_theme_data to the deprecated.php file, change its use…

… of constants to the equivalent getter functions, and officially deprecate the function. Technically, it was deprecated in 1.4.0, but it was never marked as such.
  • Loading branch information...
commit bcdee64520e66e288ad49e520380c9240f0b1a0b 1 parent dd55e94
@justintadlock authored
Showing with 41 additions and 37 deletions.
  1. +0 −37 functions/core.php
  2. +41 −0 functions/deprecated.php
View
37 functions/core.php
@@ -182,41 +182,4 @@ function hybrid_get_content_width() {
return $content_width;
}
-/**
- * Gets theme data and stores it in the global $hybrid variable. By storing it, it can be accessed quickly without
- * having to run through the get_theme_data() function again.
- *
- * @since 1.2.0
- * @access public
- * @param string $path Whether to use the template (parent theme) or stylesheet (child theme) path.
- */
-function hybrid_get_theme_data( $path = 'template' ) {
- global $hybrid;
-
- /* If 'template' is requested, get the parent theme data. */
- if ( 'template' == $path ) {
-
- /* If the parent theme data isn't set, grab it with the get_theme_data() function. */
- if ( empty( $hybrid->theme_data ) )
- $hybrid->theme_data = get_theme_data( trailingslashit( TEMPLATEPATH ) . 'style.css' );
-
- /* Return the parent theme data. */
- return $hybrid->theme_data;
- }
-
- /* If 'stylesheet' is requested, get the child theme data. */
- elseif ( 'stylesheet' == $path ) {
-
- /* If the child theme data isn't set, grab it with the get_theme_data() function. */
- if ( empty( $hybrid->child_theme_data ) )
- $hybrid->child_theme_data = get_theme_data( trailingslashit( STYLESHEETPATH ) . 'style.css' );
-
- /* Return the child theme data. */
- return $hybrid->child_theme_data;
- }
-
- /* Return false for everything else. */
- return false;
-}
-
?>
View
41 functions/deprecated.php
@@ -426,6 +426,47 @@ function hybrid_load_textdomain( $mofile, $domain ) {
return hybrid_load_textdomain_mofile( $mofile, $domain );
}
+/**
+ * Gets theme data and stores it in the global $hybrid variable. By storing it, it can be accessed quickly without
+ * having to run through the get_theme_data() function again.
+ *
+ * @since 1.2.0
+ * @deprecated 1.5.0
+ * @access public
+ * @param string $path Whether to use the template (parent theme) or stylesheet (child theme) path.
+ */
+function hybrid_get_theme_data( $path = 'template' ) {
+
+ _deprecated_function( __FUNCTION__, '1.5.0', 'wp_get_theme' );
+
+ global $hybrid;
+
+ /* If 'template' is requested, get the parent theme data. */
+ if ( 'template' == $path ) {
+
+ /* If the parent theme data isn't set, grab it with the get_theme_data() function. */
+ if ( empty( $hybrid->theme_data ) )
+ $hybrid->theme_data = get_theme_data( trailingslashit( get_template_directory() ) . 'style.css' );
+
+ /* Return the parent theme data. */
+ return $hybrid->theme_data;
+ }
+
+ /* If 'stylesheet' is requested, get the child theme data. */
+ elseif ( 'stylesheet' == $path ) {
+
+ /* If the child theme data isn't set, grab it with the get_theme_data() function. */
+ if ( empty( $hybrid->child_theme_data ) )
+ $hybrid->child_theme_data = get_theme_data( trailingslashit( get_stylesheet_directory() ) . 'style.css' );
+
+ /* Return the child theme data. */
+ return $hybrid->child_theme_data;
+ }
+
+ /* Return false for everything else. */
+ return false;
+}
+
/* === Removed Functions === */
/* Functions removed in the 0.8 branch. */
Please sign in to comment.
Something went wrong with that request. Please try again.