[wp-trac] [WordPress Trac] #34259: Dynamic 'do_feed_{$feed}' action should have a static equivalent

WordPress Trac noreply at wordpress.org
Mon Oct 12 16:05:55 UTC 2015


#34259: Dynamic 'do_feed_{$feed}' action should have a static equivalent
-------------------------------------------------+-------------------------
 Reporter:  slimndap                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Feeds                                |  Review
 Severity:  normal                               |     Version:  4.3.1
 Keywords:  needs-patch needs-docs reporter-     |  Resolution:
  feedback                                       |     Focuses:  template
-------------------------------------------------+-------------------------

Comment (by slimndap):

 Yes, that is exactly the point. The plugin needs to check the value of
 `$feed` to know which feed to show.

 This is not possible with the existing dynamic hook, nor with the callback
 function that you set with `add_feed()`.
 `$feed` is not available.

 So for example:

 1. My users sets up a feed that always shows events for the coming week.
 He creates a new feed named 'Events this week'. He then sets 'Next Monday'
 as the start date and 'Next Monday + 1 week' as the end date.
 1. My plugin uses `add_feed(sanitize_title($feed['name']),
 'my_plugin_add_feed'))` to add the feed.
 1. The `my_plugin_add_feed()` function will render the feed.

 The problem is that `my_plugin_add_feed()` needs to know which feed it is
 supposed to show in order to use the proper start and end dates. This
 information is not available. Currently you need to dig into the query
 vars to figure it out.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34259#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list