src/Modules/Dashboard_widget.php
private function setup_feeds() {
		if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) {
			// Load SimplePie Instance.
			$feed = fetch_feed( $this->feeds );
			// TODO report error when is an error loading the feed.
			if ( is_wp_error( $feed ) ) {
				return;
			}

			$items = $feed->get_items( 0, 5 );
			foreach ( (array) $items as $item ) {
				$items_normalized[] = array(
					'title' => $item->get_title(),
					'date'  => $item->get_date( 'U' ),
					'link'  => $item->get_permalink(),
				);
			}
			set_transient( 'themeisle_sdk_feed_items', $items_normalized, 48 * HOUR_IN_SECONDS );
		}
		$this->items = $items_normalized;
	}
private function setup_feeds() {
		if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) {
			// Load SimplePie Instance.
			$feed = fetch_feed( $this->feeds );
			// TODO report error when is an error loading the feed.
			if ( is_wp_error( $feed ) ) {
				return;
			}

			$items = $feed->get_items( 0, 5 );
			foreach ( (array) $items as $item ) {
				$items_normalized[] = array(
					'title' => $item->get_title(),
					'date'  => $item->get_date( 'U' ),
					'link'  => $item->get_permalink(),
				);
			}
			set_transient( 'themeisle_sdk_feed_items', $items_normalized, 48 * HOUR_IN_SECONDS );
		}
		$this->items = $items_normalized;
	}
private function setup_feeds ( ) { if ( false === ( $ items_normalized = get_transient ( 'themeisle_sdk_feed_items' ) ) ) { // Load SimplePie Instance. $ feed = fetch_feed ( $ this -> feeds ) ; // TODO report error when is an error loading the feed. if ( is_wp_error ( $ feed ) ) { return ; } $ items = $ feed -> get_items ( 0 , 5 ) ; foreach ( ( array ) $ items as $ item ) { $ items_normalized [ ] = array ( 'title' => $ item -> get_title ( ) , 'date' => $ item -> get_date ( 'U' ) , 'link' => $ item -> get_permalink ( ) , ) ; } set_transient ( 'themeisle_sdk_feed_items' , $ items_normalized , 48 * HOUR_IN_SECONDS ) ; } $ this -> items = $ items_normalized ; }
Setup feed items.
Setup feed items .