Ticket #12364 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Deprecate automatic_feed_links() in favor of add_theme_support()

Reported by: Viper007Bond Owned by: Viper007Bond
Priority: normal Milestone: 3.0
Component: Themes Version: 3.0
Severity: normal Keywords: has-patch
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

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

Change History

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.

  • Keywords has-patch added

comment:3   dd322 years ago

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

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

comment:4 follow-up: ↓ 5   TobiasBg2 years ago

  • Status changed from closed to reopened
  • Resolution fixed deleted

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   Viper007Bond2 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.

Full backwards compatibility

comment:6   dd322 years ago

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

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