Deprecate automatic_feed_links() in favor of add_theme_support('automatic-feed-links'). Props Viper007Bond. Fixes #12364

git-svn-id: https://develop.svn.wordpress.org/trunk@13398 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-02-25 08:56:19 +00:00
parent 618803a53e
commit 49dce31f70
6 changed files with 26 additions and 26 deletions

View File

@ -4,7 +4,7 @@
* @subpackage Classic_Theme
*/
automatic_feed_links();
add_theme_support( 'automatic-feed-links' );
if ( function_exists('register_sidebar') )
register_sidebar(array(

View File

@ -6,7 +6,7 @@
$content_width = 450;
automatic_feed_links();
add_theme_support( 'automatic-feed-links' );
if ( function_exists('register_sidebar') ) {
register_sidebar(array(

View File

@ -2,7 +2,7 @@
// Set the content width based on the Theme CSS
if ( ! isset( $content_width ) )
$content_width = 640;
$content_width = 640;
if ( ! function_exists( 'twentyten_init' ) ) :
function twentyten_init() {
@ -26,8 +26,8 @@ function twentyten_init() {
// so we want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit)
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
// Add default posts and comments RSS feed links to head.
automatic_feed_links();
// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// Make theme available for translation
// Translations can be filed in the /languages/ directory

View File

@ -168,8 +168,9 @@ add_filter( 'editable_slug', 'urldecode' );
add_filter( 'atom_service_url','atom_service_url_filter' );
// Actions
add_action( 'wp_head', 'wp_enqueue_scripts', 1 );
add_action( 'wp_head', 'feed_links_extra', 3 );
add_action( 'wp_head', 'wp_enqueue_scripts', 1 );
add_action( 'wp_head', 'feed_links', 3 );
add_action( 'wp_head', 'feed_links_extra', 3 );
add_action( 'wp_head', 'rsd_link' );
add_action( 'wp_head', 'wlwmanifest_link' );
add_action( 'wp_head', 'index_rel_link' );
@ -178,9 +179,9 @@ add_action( 'wp_head', 'start_post_rel_link', 10, 0 );
add_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
add_action( 'wp_head', 'locale_stylesheet' );
add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );
add_action( 'wp_head', 'noindex', 1 );
add_action( 'wp_head', 'wp_print_styles', 8 );
add_action( 'wp_head', 'wp_print_head_scripts', 9 );
add_action( 'wp_head', 'noindex', 1 );
add_action( 'wp_head', 'wp_print_styles', 8 );
add_action( 'wp_head', 'wp_print_head_scripts', 9 );
add_action( 'wp_head', 'wp_generator' );
add_action( 'wp_head', 'rel_canonical' );
add_action( 'wp_footer', 'wp_print_footer_scripts' );

View File

@ -2411,4 +2411,16 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
return true;
}
/**
* Enable automatic general feed link outputting.
*
* @since 2.8.0
* @deprecated 3.0.0
* @deprecated Use add_theme_support( 'automatic-feed-links' )
*/
function automatic_feed_links() {
_deprecated_function( __FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )" );
add_theme_support( 'automatic-feed-links' );
}

View File

@ -1561,22 +1561,6 @@ function wp_footer() {
do_action('wp_footer');
}
/**
* Enable/disable automatic general feed link outputting.
*
* @since 2.8.0
*
* @param boolean $add Optional, default is true. Add or remove links. Defaults to true.
*/
function automatic_feed_links( $add = true ) {
if ( $add )
add_action( 'wp_head', 'feed_links', 2 );
else {
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
}
}
/**
* Display the links to the general feeds.
*
@ -1585,6 +1569,9 @@ function automatic_feed_links( $add = true ) {
* @param array $args Optional arguments.
*/
function feed_links( $args = array() ) {
if ( !current_theme_supports('automatic-feed-links') )
return;
$defaults = array(
/* translators: Separator between blog name and feed type in feed links */
'separator' => _x('»', 'feed link'),