post_type) || !$url = wp_get_attachment_url($_post->ID) )
+ return __('Missing Attachment');
+
+ if ( $permalink )
+ $url = get_attachment_link($_post->ID);
+
+ $post_title = esc_attr($_post->post_title);
+
+ $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);
+ return "$innerHTML";
+}
+
+/**
+ * Retrieve icon URL and Path.
+ *
+ * @since 2.1.0
+ * @deprecated 2.5.0
+ * @deprecated Use wp_get_attachment_image_src()
+ * @see wp_get_attachment_image_src()
+ *
+ * @param int $id Optional. Post ID.
+ * @param bool $fullsize Optional, default to false. Whether to have full image.
+ * @return array Icon URL and full path to file, respectively.
+ */
+function get_attachment_icon_src( $id = 0, $fullsize = false ) {
+ _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' );
+ $id = (int) $id;
+ if ( !$post = & get_post($id) )
+ return false;
+
+ $file = get_attached_file( $post->ID );
+
+ if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
+ // We have a thumbnail desired, specified and existing
+
+ $src_file = basename($src);
+ $class = 'attachmentthumb';
+ } elseif ( wp_attachment_is_image( $post->ID ) ) {
+ // We have an image without a thumbnail
+
+ $src = wp_get_attachment_url( $post->ID );
+ $src_file = & $file;
+ $class = 'attachmentimage';
+ } elseif ( $src = wp_mime_type_icon( $post->ID ) ) {
+ // No thumb, no image. We'll look for a mime-related icon instead.
+
+ $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
+ $src_file = $icon_dir . '/' . basename($src);
+ }
+
+ if ( !isset($src) || !$src )
+ return false;
+
+ return array($src, $src_file);
+}
+
+/**
+ * Retrieve HTML content of icon attachment image element.
+ *
+ * @since 2.0.0
+ * @deprecated 2.5.0
+ * @deprecated Use wp_get_attachment_image()
+ * @see wp_get_attachment_image()
+ *
+ * @param int $id Optional. Post ID.
+ * @param bool $fullsize Optional, default to false. Whether to have full size image.
+ * @param array $max_dims Optional. Dimensions of image.
+ * @return string HTML content.
+ */
+function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
+ _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
+ $id = (int) $id;
+ if ( !$post = & get_post($id) )
+ return false;
+
+ if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )
+ return false;
+
+ list($src, $src_file) = $src;
+
+ // Do we need to constrain the image?
+ if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
+
+ $imagesize = getimagesize($src_file);
+
+ if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
+ $actual_aspect = $imagesize[0] / $imagesize[1];
+ $desired_aspect = $max_dims[0] / $max_dims[1];
+
+ if ( $actual_aspect >= $desired_aspect ) {
+ $height = $actual_aspect * $max_dims[0];
+ $constraint = "width='{$max_dims[0]}' ";
+ $post->iconsize = array($max_dims[0], $height);
+ } else {
+ $width = $max_dims[1] / $actual_aspect;
+ $constraint = "height='{$max_dims[1]}' ";
+ $post->iconsize = array($width, $max_dims[1]);
+ }
+ } else {
+ $post->iconsize = array($imagesize[0], $imagesize[1]);
+ $constraint = '';
+ }
+ } else {
+ $constraint = '';
+ }
+
+ $post_title = esc_attr($post->post_title);
+
+ $icon = "
";
+
+ return apply_filters( 'attachment_icon', $icon, $post->ID );
+}
+
+/**
+ * Retrieve HTML content of image element.
+ *
+ * @since 2.0.0
+ * @deprecated 2.5.0
+ * @deprecated Use wp_get_attachment_image()
+ * @see wp_get_attachment_image()
+ *
+ * @param int $id Optional. Post ID.
+ * @param bool $fullsize Optional, default to false. Whether to have full size image.
+ * @param array $max_dims Optional. Dimensions of image.
+ * @return string
+ */
+function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
+ _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' );
+ $id = (int) $id;
+ if ( !$post = & get_post($id) )
+ return false;
+
+ if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
+ return $innerHTML;
+
+
+ $innerHTML = esc_attr($post->post_title);
+
+ return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
+}
+
+/*
+ * Retrieve bookmark data based on ID.
+ *
+ * @since 2.0.0
+ * @deprecated 2.1.0
+ * @deprecated Use get_bookmark()
+ * @see get_bookmark()
+ *
+ * @param int $bookmark_id ID of link
+ * @param string $output OBJECT, ARRAY_N, or ARRAY_A
+ * @return object|array
+ */
+function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') {
+ _deprecated_function( __FUNCTION__, '2.1', 'get_bookmark()' );
+ return get_bookmark($bookmark_id, $output, $filter);
+}
+
?>
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index 3dddb61695..e8e15002a1 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -1636,9 +1636,10 @@ endif;
if ( !function_exists('wp_setcookie') ) :
/**
- * Sets a cookie for a user who just logged in.
+ * Sets a cookie for a user who just logged in. This function is deprecated.
*
* @since 1.5
+ * @deprecated 2.5
* @deprecated Use wp_set_auth_cookie()
* @see wp_set_auth_cookie()
*
@@ -1658,9 +1659,10 @@ endif;
if ( !function_exists('wp_clearcookie') ) :
/**
- * Clears the authentication cookie, logging the user out.
+ * Clears the authentication cookie, logging the user out. This function is deprecated.
*
* @since 1.5
+ * @deprecated 2.5
* @deprecated Use wp_clear_auth_cookie()
* @see wp_clear_auth_cookie()
*/
@@ -1672,25 +1674,26 @@ endif;
if ( !function_exists('wp_get_cookie_login') ):
/**
- * Gets the user cookie login.
+ * Gets the user cookie login. This function is deprecated.
*
* This function is deprecated and should no longer be extended as it won't be
* used anywhere in WordPress. Also, plugins shouldn't use it either.
*
* @since 2.0.3
+ * @deprecated 2.5
* @deprecated No alternative
*
* @return bool Always returns false
*/
function wp_get_cookie_login() {
- _deprecated_function( __FUNCTION__, '2.5', '' );
+ _deprecated_function( __FUNCTION__, '2.5' );
return false;
}
endif;
if ( !function_exists('wp_login') ) :
/**
- * Checks a users login information and logs them in if it checks out.
+ * Checks a users login information and logs them in if it checks out. This function is deprecated.
*
* Use the global $error to get the reason why the login failed. If the username
* is blank, no error will be set, so assume blank username on that case.
@@ -1709,6 +1712,7 @@ if ( !function_exists('wp_login') ) :
* @return bool False on login failure, true on successful check
*/
function wp_login($username, $password, $deprecated = '') {
+ _deprecated_function( __FUNCTION__, '2.5', 'wp_signon()' );
global $error;
$user = wp_authenticate($username, $password);
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index c8c3fe3b8c..3e81670768 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -952,158 +952,6 @@ function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false
return apply_filters( 'wp_get_attachment_link', "$link_text", $id, $size, $permalink, $icon, $text );
}
-/**
- * Retrieve HTML content of attachment image with link.
- *
- * @since 2.0.0
- * @deprecated Use {@link wp_get_attachment_link()}
- * @see wp_get_attachment_link() Use instead.
- *
- * @param int $id Optional. Post ID.
- * @param bool $fullsize Optional, default is false. Whether to use full size image.
- * @param array $max_dims Optional. Max image dimensions.
- * @param bool $permalink Optional, default is false. Whether to include permalink to image.
- * @return string
- */
-function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {
- $id = (int) $id;
- $_post = & get_post($id);
-
- if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
- return __('Missing Attachment');
-
- if ( $permalink )
- $url = get_attachment_link($_post->ID);
-
- $post_title = esc_attr($_post->post_title);
-
- $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);
- return "$innerHTML";
-}
-
-/**
- * Retrieve icon URL and Path.
- *
- * @since 2.1.0
- * @deprecated Use {@link wp_get_attachment_image_src()}
- * @see wp_get_attachment_image_src() Use instead.
- *
- * @param int $id Optional. Post ID.
- * @param bool $fullsize Optional, default to false. Whether to have full image.
- * @return array Icon URL and full path to file, respectively.
- */
-function get_attachment_icon_src( $id = 0, $fullsize = false ) {
- $id = (int) $id;
- if ( !$post = & get_post($id) )
- return false;
-
- $file = get_attached_file( $post->ID );
-
- if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
- // We have a thumbnail desired, specified and existing
-
- $src_file = basename($src);
- $class = 'attachmentthumb';
- } elseif ( wp_attachment_is_image( $post->ID ) ) {
- // We have an image without a thumbnail
-
- $src = wp_get_attachment_url( $post->ID );
- $src_file = & $file;
- $class = 'attachmentimage';
- } elseif ( $src = wp_mime_type_icon( $post->ID ) ) {
- // No thumb, no image. We'll look for a mime-related icon instead.
-
- $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
- $src_file = $icon_dir . '/' . basename($src);
- }
-
- if ( !isset($src) || !$src )
- return false;
-
- return array($src, $src_file);
-}
-
-/**
- * Retrieve HTML content of icon attachment image element.
- *
- * @since 2.0.0
- * @deprecated Use {@link wp_get_attachment_image()}
- * @see wp_get_attachment_image() Use instead of.
- *
- * @param int $id Optional. Post ID.
- * @param bool $fullsize Optional, default to false. Whether to have full size image.
- * @param array $max_dims Optional. Dimensions of image.
- * @return string HTML content.
- */
-function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
- $id = (int) $id;
- if ( !$post = & get_post($id) )
- return false;
-
- if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )
- return false;
-
- list($src, $src_file) = $src;
-
- // Do we need to constrain the image?
- if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
-
- $imagesize = getimagesize($src_file);
-
- if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
- $actual_aspect = $imagesize[0] / $imagesize[1];
- $desired_aspect = $max_dims[0] / $max_dims[1];
-
- if ( $actual_aspect >= $desired_aspect ) {
- $height = $actual_aspect * $max_dims[0];
- $constraint = "width='{$max_dims[0]}' ";
- $post->iconsize = array($max_dims[0], $height);
- } else {
- $width = $max_dims[1] / $actual_aspect;
- $constraint = "height='{$max_dims[1]}' ";
- $post->iconsize = array($width, $max_dims[1]);
- }
- } else {
- $post->iconsize = array($imagesize[0], $imagesize[1]);
- $constraint = '';
- }
- } else {
- $constraint = '';
- }
-
- $post_title = esc_attr($post->post_title);
-
- $icon = "
";
-
- return apply_filters( 'attachment_icon', $icon, $post->ID );
-}
-
-/**
- * Retrieve HTML content of image element.
- *
- * @since 2.0.0
- * @deprecated Use {@link wp_get_attachment_image()}
- * @see wp_get_attachment_image() Use instead.
- *
- * @param int $id Optional. Post ID.
- * @param bool $fullsize Optional, default to false. Whether to have full size image.
- * @param array $max_dims Optional. Dimensions of image.
- * @return string
- */
-function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
- $id = (int) $id;
- if ( !$post = & get_post($id) )
- return false;
-
- if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))
- return $innerHTML;
-
-
- $innerHTML = esc_attr($post->post_title);
-
- return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
-}
-
/**
* Wrap attachment in <> element before content.
*