WordPress SimplePie modifications

SimplePie in WordPress uses the built-in kses sanitization, rather than SimplePie’s. Instead, you can filter on wp_kses_allowed_html and add your elements there. Keep in mind that this will occur for all post santization, not just via SimplePie. function se87359_add_allowed_tags($tags) { $tags[‘mytag’] = array(‘myattr’ => true); return $tags; } add_filter(‘wp_kses_allowed_html’, ‘se87359_add_allowed_tags’); If you want to do … Read more

How to use cache with simplepie

The example your using from the codex adds and removes it (probably not something you want to do), and is not very clear. By default WordPress will cache the feed for 12 hours using wp_feed_cache_transient_lifetime, the actual code WP uses for 12 hours is $lifetime = 43200 If you want to alter the cache time … Read more

Why does Simplepie return feed items in a wrong order?

At the end of class-simplepie.php there is this line: usort($items, array(get_class($urls[0]), ‘sort_items’)); Which force-sorts feed elements, in case of multifeed. The $feed->enable_order_by_date(false); is indeed very important and the key to things, BUT it gets disregarded (what I was experiencing) if I use multifeed. Source: in get_items() of class-simplepie.php there is this: // If we want … Read more