From 70791f60b9feed09b1684076e1821e57da67bca6 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 9 Jul 2012 21:10:59 +0000 Subject: [PATCH] Deprecate sticky_class() in favor of post_class(). props solarissmoke, fixes #16675. git-svn-id: http://core.svn.wordpress.org/trunk@21253 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/deprecated.php | 24 ++++++++++++++++++++---- wp-includes/post-template.php | 14 -------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index da1c727985..023767810c 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -3097,7 +3097,7 @@ function remove_custom_background() { * @return array Theme data. */ function get_theme_data( $theme_file ) { - _deprecated_function( __FUNCTION__, 3.4, 'wp_get_theme()' ); + _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' ); $theme = new WP_Theme( basename( dirname( $theme_file ) ), dirname( dirname( $theme_file ) ) ); $theme_data = array( @@ -3133,7 +3133,7 @@ function get_theme_data( $theme_file ) { * @param array $pages list of page objects */ function update_page_cache( &$pages ) { - _deprecated_function( __FUNCTION__, 3.4, 'update_post_cache()' ); + _deprecated_function( __FUNCTION__, '3.4', 'update_post_cache()' ); update_post_cache( $pages ); } @@ -3152,7 +3152,7 @@ function update_page_cache( &$pages ) { * @param int $id Page ID to clean */ function clean_page_cache( $id ) { - _deprecated_function( __FUNCTION__, 3.4, 'clean_post_cache()' ); + _deprecated_function( __FUNCTION__, '3.4', 'clean_post_cache()' ); clean_post_cache( $id ); } @@ -3173,4 +3173,20 @@ function clean_page_cache( $id ) { function wp_explain_nonce( $action ) { _deprecated_function( __FUNCTION__, '3.4.1', 'wp_nonce_ays()' ); return __( 'Are you sure you want to do this?' ); -} \ No newline at end of file +} + +/** + * Display "sticky" CSS class, if a post is sticky. + * + * @since 2.7.0 + * @deprecated 3.5.0 + * @deprecated Use post_class() + * @see post_class() + * + * @param int $post_id An optional post ID. + */ +function sticky_class( $post_id = null ) { + _deprecated_function( __FUNCTION__, '3.5', 'post_class()' ); + if ( is_sticky( $post_id ) ) + echo ' sticky'; +} diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 6c3e4c51e1..0581a104ca 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -572,20 +572,6 @@ function post_password_required( $post = null ) { return ! $wp_hasher->CheckPassword( $post->post_password, $hash ); } -/** - * Display "sticky" CSS class, if a post is sticky. - * - * @since 2.7.0 - * - * @param int $post_id An optional post ID. - */ -function sticky_class( $post_id = null ) { - if ( !is_sticky($post_id) ) - return; - - echo " sticky"; -} - /** * Page Template Functions for usage in Themes *