Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#12364 closed enhancement (fixed)

Deprecate automatic_feed_links() in favor of add_theme_support()

Reported by: viper007bond's profile Viper007Bond Owned by: viper007bond's profile Viper007Bond
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

add_theme_support() didn't exist when I wrote automatic_feed_links(). It'd be much more appropriate to use it now. Something like add_theme_support( 'automatic-feed-links' ) or something.

As a reminder: automatic_feed_links() tells WordPress that your theme doesn't contain any feed links in it's <head> and that WordPress should dynamically add them itself based on what page the user is viewing. This isn't done by default to avoid duplicate feed link output in older themes.

Fairly simple change, can be slipped into 3.0 I think. I'll have a patch ASAP.

Attachments (2)

12364.patch (5.4 KB) - added by Viper007Bond 15 years ago.
12364.2.patch (1.7 KB) - added by Viper007Bond 15 years ago.
Full backwards compatibility

Download all attachments as: .zip

Change History (9)

#1 @nacin
15 years ago

Big +1, nice idea. Putting it alongside other things that themes should support should raise its profile a bit as well. We should probably put this into Kubrick also.

@Viper007Bond
15 years ago

#2 @Viper007Bond
15 years ago

  • Keywords has-patch added

#3 @dd32
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

#4 follow-up: @TobiasBg
15 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

From what I can see, there's now no longer a possibility to automatically have the call to feed_links_extra() removed.

While before the commit, this could be achieved by automatic_feed_links( false );, one would now have to manually add the remove_action(...) call.

This breaks backward compatibility.

I suggest to also add

if ( !current_theme_supports('automatic-feed-links') ) 
   return;

to feed_links_extra().

#5 in reply to: ↑ 4 @Viper007Bond
15 years ago

Replying to TobiasBg:

I suggest to also add

if ( !current_theme_supports('automatic-feed-links') ) 
   return;

to feed_links_extra().

No because feed_links_extra() ran by default (without the function call).

You're right though that I shouldn't break backwards compatibility, especially when it's easy not to.

Incoming patch.

@Viper007Bond
15 years ago

Full backwards compatibility

#6 @dd32
15 years ago

(In [13399]) Restore backwards compatibility in automatic_feed_links() to deregister the extra feeds. Props Viper007Bond. See #12364

#7 @nacin
15 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.