Permalink
Browse files

Switch theme link shortcodes to use the new wp_get_theme() function.

  • Loading branch information...
1 parent 7ffe8b7 commit ef84d262df382f32a8b023bb134a3164de52441b @justintadlock committed Jun 10, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 functions/shortcodes.php
View
@@ -102,8 +102,8 @@ function hybrid_wp_link_shortcode() {
* @return string
*/
function hybrid_theme_link_shortcode() {
- $data = hybrid_get_theme_data();
- return '<a class="theme-link" href="' . esc_url( $data['URI'] ) . '" title="' . sprintf( esc_attr__( '%s WordPress Theme', 'hybrid-core' ), $data['Name'] ) . '"><span>' . esc_attr( $data['Name'] ) . '</span></a>';
+ $theme = wp_get_theme( get_template(), get_theme_root( get_template_directory() ) );
+ return '<a class="theme-link" href="' . esc_url( $theme->get( 'ThemeURI' ) ) . '" title="' . sprintf( esc_attr__( '%s WordPress Theme', 'hybrid-core' ), $theme->get( 'Name' ) ) . '"><span>' . esc_attr( $theme->get( 'Name' ) ) . '</span></a>';
}
/**
@@ -115,8 +115,8 @@ function hybrid_theme_link_shortcode() {
* @return string
*/
function hybrid_child_link_shortcode() {
- $data = hybrid_get_theme_data( 'stylesheet' );
- return '<a class="child-link" href="' . esc_url( $data['URI'] ) . '" title="' . esc_attr( $data['Name'] ) . '"><span>' . esc_html( $data['Name'] ) . '</span></a>';
+ $theme = wp_get_theme( get_stylesheet(), get_theme_root( get_stylesheet_directory() ) );
+ return '<a class="child-link" href="' . esc_url( $theme->get( 'ThemeURI' ) ) . '" title="' . esc_attr( $theme->get( 'Name' ) ) . '"><span>' . esc_html( $theme->get( 'Name' ) ) . '</span></a>';
}
/**

0 comments on commit ef84d26

Please sign in to comment.