pmpro_fetch_rss_items

The Paid Memberships Pro pmpro fetch rss items function.

Description

pmpro_fetch_rss_items( $num ); 

Parameters (1)

0. $num
The num.

Usage

  1. if ( !function_exists( 'pmpro_fetch_rss_items' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/adminpages/dashboard.php'; 
  3.  
  4. // The num. 
  5. $num = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_fetch_rss_items($num); 
  9.  

Defined (1)

The function is defined in the following location(s).

/adminpages/dashboard.php  
  1. function pmpro_fetch_rss_items( $num ) 
  2. global $pmpro_feed; 
  3.  
  4. include_once(ABSPATH . WPINC . '/feed.php'); 
  5. $rss = fetch_feed( $pmpro_feed ); 
  6.  
  7. // Bail if feed doesn't work 
  8. if ( is_wp_error($rss) ) 
  9. return false; 
  10.  
  11. $rss_items = $rss->get_items( 0, $rss->get_item_quantity( $num ) ); 
  12.  
  13. // If the feed was erroneously 
  14. if ( !$rss_items ) { 
  15. $md5 = md5( $pmpro_feed ); 
  16. delete_transient( 'feed_' . $md5 ); 
  17. delete_transient( 'feed_mod_' . $md5 ); 
  18. $rss = fetch_feed( $pmpro_feed ); 
  19. $rss_items = $rss->get_items( 0, $rss->get_item_quantity( $num ) ); 
  20.  
  21. return $rss_items;