feeds' ), array( $this, 'dashboard' ), array( $this, 'dashboard_control' ) ); } /** * Fetch RSS items from the feed. * * @param int $num Number of items to fetch. * @param string $feed The feed to fetch. * @return array|bool False on error, array of RSS items on success. */ public function fetch_rss_items( $num, $feed ) { include_once( ABSPATH . WPINC . '/feed.php' ); $rss = fetch_feed( $feed ); // Bail if feed doesn't work if ( !$rss || is_wp_error( $rss ) ) return false; $rss_items = $rss->get_items( 0, $rss->get_item_quantity( $num ) ); // If the feed was erroneous if ( !$rss_items ) { $md5 = md5( $feed ); delete_transient( 'feed_' . $md5 ); delete_transient( 'feed_mod_' . $md5 ); $rss = fetch_feed( $feed ); $rss_items = $rss->get_items( 0, $rss->get_item_quantity( $num ) ); } return $rss_items; } /** * Output CSS * * @return string */ function style() { ?> fetch_rss_items( $item_count, 'http://pipes.yahoo.com/pipes/pipe.run?_id=52c339c010550750e3e64d478b1c96ea&_render=rss' ); $this->style(); $content = ''; echo $content; } /** * Print the dashboard control widget * * @return string */ function dashboard_control() { if ( !$widget_options = get_option( 'the_frosty_dashboard_widget_options' ) ) $widget_options = array(); if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) && 'thefrosty_dashboard' == $_POST['widget_id'] ) { $items = stripslashes_deep( $_POST['thefrosty_dashboard_items'] ); $widget_options['items'] = $items; update_option( 'the_frosty_dashboard_widget_options', $widget_options ); } //print_r( $widget_options ); ?>