Deprecate automatic_feed_links() in favor of add_theme_support('automatic-feed-links'). Props Viper007Bond. Fixes #12364
git-svn-id: http://svn.automattic.com/wordpress/trunk@13398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
280a19ff6c
commit
f51247ef50
|
@ -4,7 +4,7 @@
|
||||||
* @subpackage Classic_Theme
|
* @subpackage Classic_Theme
|
||||||
*/
|
*/
|
||||||
|
|
||||||
automatic_feed_links();
|
add_theme_support( 'automatic-feed-links' );
|
||||||
|
|
||||||
if ( function_exists('register_sidebar') )
|
if ( function_exists('register_sidebar') )
|
||||||
register_sidebar(array(
|
register_sidebar(array(
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
$content_width = 450;
|
$content_width = 450;
|
||||||
|
|
||||||
automatic_feed_links();
|
add_theme_support( 'automatic-feed-links' );
|
||||||
|
|
||||||
if ( function_exists('register_sidebar') ) {
|
if ( function_exists('register_sidebar') ) {
|
||||||
register_sidebar(array(
|
register_sidebar(array(
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// Set the content width based on the Theme CSS
|
// Set the content width based on the Theme CSS
|
||||||
if ( ! isset( $content_width ) )
|
if ( ! isset( $content_width ) )
|
||||||
$content_width = 640;
|
$content_width = 640;
|
||||||
|
|
||||||
if ( ! function_exists( 'twentyten_init' ) ) :
|
if ( ! function_exists( 'twentyten_init' ) ) :
|
||||||
function 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)
|
// 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 );
|
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
|
||||||
|
|
||||||
// Add default posts and comments RSS feed links to head.
|
// Add default posts and comments RSS feed links to head
|
||||||
automatic_feed_links();
|
add_theme_support( 'automatic-feed-links' );
|
||||||
|
|
||||||
// Make theme available for translation
|
// Make theme available for translation
|
||||||
// Translations can be filed in the /languages/ directory
|
// Translations can be filed in the /languages/ directory
|
||||||
|
|
|
@ -168,8 +168,9 @@ add_filter( 'editable_slug', 'urldecode' );
|
||||||
add_filter( 'atom_service_url','atom_service_url_filter' );
|
add_filter( 'atom_service_url','atom_service_url_filter' );
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
add_action( 'wp_head', 'wp_enqueue_scripts', 1 );
|
add_action( 'wp_head', 'wp_enqueue_scripts', 1 );
|
||||||
add_action( 'wp_head', 'feed_links_extra', 3 );
|
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', 'rsd_link' );
|
||||||
add_action( 'wp_head', 'wlwmanifest_link' );
|
add_action( 'wp_head', 'wlwmanifest_link' );
|
||||||
add_action( 'wp_head', 'index_rel_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', 'adjacent_posts_rel_link', 10, 0 );
|
||||||
add_action( 'wp_head', 'locale_stylesheet' );
|
add_action( 'wp_head', 'locale_stylesheet' );
|
||||||
add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );
|
add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );
|
||||||
add_action( 'wp_head', 'noindex', 1 );
|
add_action( 'wp_head', 'noindex', 1 );
|
||||||
add_action( 'wp_head', 'wp_print_styles', 8 );
|
add_action( 'wp_head', 'wp_print_styles', 8 );
|
||||||
add_action( 'wp_head', 'wp_print_head_scripts', 9 );
|
add_action( 'wp_head', 'wp_print_head_scripts', 9 );
|
||||||
add_action( 'wp_head', 'wp_generator' );
|
add_action( 'wp_head', 'wp_generator' );
|
||||||
add_action( 'wp_head', 'rel_canonical' );
|
add_action( 'wp_head', 'rel_canonical' );
|
||||||
add_action( 'wp_footer', 'wp_print_footer_scripts' );
|
add_action( 'wp_footer', 'wp_print_footer_scripts' );
|
||||||
|
|
|
@ -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 );
|
do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
|
||||||
|
|
||||||
return true;
|
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' );
|
||||||
}
|
}
|
|
@ -1561,22 +1561,6 @@ function wp_footer() {
|
||||||
do_action('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.
|
* Display the links to the general feeds.
|
||||||
*
|
*
|
||||||
|
@ -1585,6 +1569,9 @@ function automatic_feed_links( $add = true ) {
|
||||||
* @param array $args Optional arguments.
|
* @param array $args Optional arguments.
|
||||||
*/
|
*/
|
||||||
function feed_links( $args = array() ) {
|
function feed_links( $args = array() ) {
|
||||||
|
if ( !current_theme_supports('automatic-feed-links') )
|
||||||
|
return;
|
||||||
|
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
/* translators: Separator between blog name and feed type in feed links */
|
/* translators: Separator between blog name and feed type in feed links */
|
||||||
'separator' => _x('»', 'feed link'),
|
'separator' => _x('»', 'feed link'),
|
||||||
|
|
Loading…
Reference in New Issue