WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#12364 closed enhancement (fixed)

Deprecate automatic_feed_links() in favor of add_theme_support()

Reported by: Viper007Bond Owned by: 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 4 years ago.
12364.2.patch (1.7 KB) - added by Viper007Bond 4 years ago.
Full backwards compatibility

Download all attachments as: .zip

Change History (9)

comment:1 nacin4 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.

Viper007Bond4 years ago

comment:2 Viper007Bond4 years ago

  • Keywords has-patch added

comment:3 dd324 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

comment:4 follow-up: TobiasBg4 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().

comment:5 in reply to: ↑ 4 Viper007Bond4 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.

Viper007Bond4 years ago

Full backwards compatibility

comment:6 dd324 years ago

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

comment:7 nacin4 years ago

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