Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#11117 closed enhancement (fixed)

Add hook to allow modification of SimplePie options

Reported by: nacin's profile nacin Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9
Component: Feeds Keywords: has-patch commit
Focuses: Cc:

Description

I suggest an action is added to to the function fetch_feed() in wp-includes/feed.php. This would allow someone to add options to a SimplePie fetch without unnecessarily duplicating the function.

I also don't see a harm in allowing for different cache durations depending on the url. I would find that to be important context. So, I've also added the url as an argument to the wp_feed_cache_transient_lifetime filter.

Patch attached.

Attachments (3)

11117_1.patch (561 bytes) - added by nacin 14 years ago.
11117_2.patch (588 bytes) - added by nacin 14 years ago.
Using do_action_ref_array
11117_3.patch (587 bytes) - added by nacin 14 years ago.
$url shouldn't be by reference.

Download all attachments as: .zip

Change History (9)

@nacin
14 years ago

#1 follow-up: @scribu
14 years ago

Should probably use do_action_ref_array() instead of do_action().

#2 in reply to: ↑ 1 @nacin
14 years ago

Replying to scribu:

Should probably use do_action_ref_array() instead of do_action().

Good call, not sure how I missed that. Will patch up as array(&$feed, &$url).

@nacin
14 years ago

Using do_action_ref_array

#3 @nacin
14 years ago

  • Keywords has-patch added

@nacin
14 years ago

$url shouldn't be by reference.

#4 @ryan
14 years ago

  • Milestone changed from 2.9 to 3.0

#5 @nacin
14 years ago

  • Keywords commit added

Trivial patch, could be committed. Not unlike #11237 from today.

#6 @automattor
13 years ago

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

(In [12484]) Pass the url to the 'wp_feed_cache_transient_lifetime' filter to give more context.
Allow plugins to set extra options on SimplePie using the new 'wp_feed_options' action.
Fixes #11117 props nacin.

Note: See TracTickets for help on using tickets.