wp/wp-includes/deprecated.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
equal deleted inserted replaced
8:c7c34916027a 9:177826044cd9
  1876 	$file = get_attached_file( $post->ID );
  1876 	$file = get_attached_file( $post->ID );
  1877 
  1877 
  1878 	if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
  1878 	if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
  1879 		// We have a thumbnail desired, specified and existing
  1879 		// We have a thumbnail desired, specified and existing
  1880 
  1880 
  1881 		$src_file = basename($src);
  1881 		$src_file = wp_basename($src);
  1882 	} elseif ( wp_attachment_is_image( $post->ID ) ) {
  1882 	} elseif ( wp_attachment_is_image( $post->ID ) ) {
  1883 		// We have an image without a thumbnail
  1883 		// We have an image without a thumbnail
  1884 
  1884 
  1885 		$src = wp_get_attachment_url( $post->ID );
  1885 		$src = wp_get_attachment_url( $post->ID );
  1886 		$src_file = & $file;
  1886 		$src_file = & $file;
  1887 	} elseif ( $src = wp_mime_type_icon( $post->ID ) ) {
  1887 	} elseif ( $src = wp_mime_type_icon( $post->ID ) ) {
  1888 		// No thumb, no image. We'll look for a mime-related icon instead.
  1888 		// No thumb, no image. We'll look for a mime-related icon instead.
  1889 
  1889 
  1890 		$icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
  1890 		$icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
  1891 		$src_file = $icon_dir . '/' . basename($src);
  1891 		$src_file = $icon_dir . '/' . wp_basename($src);
  1892 	}
  1892 	}
  1893 
  1893 
  1894 	if ( !isset($src) || !$src )
  1894 	if ( !isset($src) || !$src )
  1895 		return false;
  1895 		return false;
  1896 
  1896 
  2506 	_deprecated_function( __FUNCTION__, '3.0.0', 'term_exists()' );
  2506 	_deprecated_function( __FUNCTION__, '3.0.0', 'term_exists()' );
  2507 	return term_exists( $term, $taxonomy, $parent );
  2507 	return term_exists( $term, $taxonomy, $parent );
  2508 }
  2508 }
  2509 
  2509 
  2510 /**
  2510 /**
  2511  * Is the current admin page generated by a plugin?
  2511  * Determines whether the current admin page is generated by a plugin.
  2512  *
  2512  *
  2513  * Use global $plugin_page and/or get_plugin_page_hookname() hooks.
  2513  * Use global $plugin_page and/or get_plugin_page_hookname() hooks.
  2514  *
  2514  * 
       
  2515  * For more information on this and similar theme functions, check out
       
  2516  * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
       
  2517  * Conditional Tags} article in the Theme Developer Handbook.
       
  2518  * 
  2515  * @since 1.5.0
  2519  * @since 1.5.0
  2516  * @deprecated 3.1.0
  2520  * @deprecated 3.1.0
  2517  *
  2521  *
  2518  * @global $plugin_page
  2522  * @global $plugin_page
  2519  *
  2523  *
  3052  * @param string $theme_file Theme file path.
  3056  * @param string $theme_file Theme file path.
  3053  * @return array Theme data.
  3057  * @return array Theme data.
  3054  */
  3058  */
  3055 function get_theme_data( $theme_file ) {
  3059 function get_theme_data( $theme_file ) {
  3056 	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
  3060 	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
  3057 	$theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
  3061 	$theme = new WP_Theme( wp_basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) );
  3058 
  3062 
  3059 	$theme_data = array(
  3063 	$theme_data = array(
  3060 		'Name' => $theme->get('Name'),
  3064 		'Name' => $theme->get('Name'),
  3061 		'URI' => $theme->display('ThemeURI', true, false),
  3065 		'URI' => $theme->display('ThemeURI', true, false),
  3062 		'Description' => $theme->display('Description', true, false),
  3066 		'Description' => $theme->display('Description', true, false),
  3711 
  3715 
  3712 	return '';
  3716 	return '';
  3713 }
  3717 }
  3714 
  3718 
  3715 /**
  3719 /**
  3716  * Whether the current URL is within the comments popup window.
  3720  * Determines whether the current URL is within the comments popup window.
  3717  *
  3721  * 
       
  3722  * For more information on this and similar theme functions, check out
       
  3723  * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
       
  3724  * Conditional Tags} article in the Theme Developer Handbook.
       
  3725  * 
  3718  * @since 1.5.0
  3726  * @since 1.5.0
  3719  * @deprecated 4.5.0
  3727  * @deprecated 4.5.0
  3720  *
  3728  *
  3721  * @return bool
  3729  * @return bool
  3722  */
  3730  */
  3735 function comments_popup_script() {
  3743 function comments_popup_script() {
  3736 	_deprecated_function( __FUNCTION__, '4.5.0' );
  3744 	_deprecated_function( __FUNCTION__, '4.5.0' );
  3737 }
  3745 }
  3738 
  3746 
  3739 /**
  3747 /**
  3740  * Adds element attributes to open links in new windows.
  3748  * Adds element attributes to open links in new tabs.
  3741  *
  3749  *
  3742  * @since 0.71
  3750  * @since 0.71
  3743  * @deprecated 4.5.0
  3751  * @deprecated 4.5.0
  3744  *
  3752  *
  3745  * @param string $text Content to replace links to open in a new window.
  3753  * @param string $text Content to replace links to open in a new tab.
  3746  * @return string Content that has filtered links.
  3754  * @return string Content that has filtered links.
  3747  */
  3755  */
  3748 function popuplinks( $text ) {
  3756 function popuplinks( $text ) {
  3749 	_deprecated_function( __FUNCTION__, '4.5.0' );
  3757 	_deprecated_function( __FUNCTION__, '4.5.0' );
  3750 	$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);
  3758 	$text = preg_replace('/<a (.+?)>/i', "<a $1 target='_blank' rel='external'>", $text);