_aURLs = is_array( $asURLs ) ? $asURLs : ( empty( $asURLs ) ? array() : ( array ) $asURLs ); } /** * * @return array */ public function get( $iItems=0 ) { $_aOutput = array(); $_aURLs = $this->_aURLs; if ( empty( $_aURLs ) ) { return $_aOutput; } $_oFeed = fetch_feed( $_aURLs ); if ( is_wp_error( $_oFeed ) ) { return $_aOutput; } foreach ( $_oFeed->get_items() as $_oItem ) { $_aOutput[ $_oItem->get_title() ] = array( 'content' => $_oItem->get_content(), 'description' => $_oItem->get_description(), 'title' => $_oItem->get_title(), 'date' => $_oItem->get_date( 'j F Y, g:i a' ), 'author' => $_oItem->get_author(), 'link' => $_oItem->get_permalink(), // get_link() may be used as well ); } if ( $iItems ) { array_splice( $_aOutput, $iItems ); } return $_aOutput; } }