public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Show the latest news.
 *
 * @since 1.0.0
 *
 * @param object $page A reference to the page object showing information.
 */
Show the latest news.

@param object $page A reference to the page object showing information.
Show the latest news . @param object $page A reference to the page object showing information .
function WPCW_docs_showSupportInfo_News( $page ) {
	$page->openPane( 'wpcw-docs-support-news', __( 'Latest news from FlyPlugins.com', 'wp-courseware' ) );
	$rss = fetch_feed( 'http://feeds.feedburner.com/FlyPlugins' );
	if ( ! is_wp_error( $rss ) ) {
		$rss_items = $rss->get_items( 0, $rss->get_item_quantity( 2 ) );
		$content = '<ul>';
		if ( ! $rss_items ) {
			$content .= '<li class="fly">' . __( 'No news items, feed might be broken...', 'wp-courseware' ) . '</li>';
		} else {
			foreach ( $rss_items as $item ) {
				$url     = preg_replace( '/#.*/', '', esc_url( $item->get_permalink(), $protocolls = null, 'display' ) );
				$content .= '<li class="fly">';
				$content .= '<a class="rsswidget" href="' . $url . '">' . esc_html( $item->get_title() ) . '</a> ';
				$content .= '</li>';
			}
		}
		$content .= '</ul>';
	}
	$content .= '<ul class="wpcw_connect">';
	$content .= '<li class="facebook"><a href="http://facebook.com/flyplugins">' . __( 'Like Fly Plugins on Facebook', 'wp-courseware' ) . '</a></li>';
	$content .= '<li class="twitter"><a href="http://twitter.com/flyplugins">' . __( 'Follow Fly Plugins on Twitter', 'wp-courseware' ) . '</a></li>';
	$content .= '<li class="youtube"><a href="http://www.youtube.com/flyplugins">' . __( 'Watch Fly Plugins on YouTube', 'wp-courseware' ) . '</a></li>';
	$content .= '</ul>';
	echo '<div class="wpcw_fly_support_news">' . $content . '</div>';
	$page->closePane();
}
function WPCW_docs_showSupportInfo_News ( $ page ) { $ page -> openPane ( 'wpcw-docs-support-news' , __ ( 'Latest news from FlyPlugins.com' , 'wp-courseware' ) ) ; $ rss = fetch_feed ( 'http://feeds.feedburner.com/FlyPlugins' ) ; if ( ! is_wp_error ( $ rss ) ) { $ rss_items = $ rss -> get_items ( 0 , $ rss -> get_item_quantity ( 2 ) ) ; $ content = '<ul>' ; if ( ! $ rss_items ) { $ content .= '<li class="fly">' . __ ( 'No news items, feed might be broken...' , 'wp-courseware' ) . '</li>' ; } else { foreach ( $ rss_items as $ item ) { $ url = preg_replace ( '/#.*/' , '' , esc_url ( $ item -> get_permalink ( ) , $ protocolls = null , 'display' ) ) ; $ content .= '<li class="fly">' ; $ content .= '<a class="rsswidget" href="' . $ url . '">' . esc_html ( $ item -> get_title ( ) ) . '</a> ' ; $ content .= '</li>' ; } } $ content .= '</ul>' ; } $ content .= '<ul class="wpcw_connect">' ; $ content .= '<li class="facebook"><a href="http://facebook.com/flyplugins">' . __ ( 'Like Fly Plugins on Facebook' , 'wp-courseware' ) . '</a></li>' ; $ content .= '<li class="twitter"><a href="http://twitter.com/flyplugins">' . __ ( 'Follow Fly Plugins on Twitter' , 'wp-courseware' ) . '</a></li>' ; $ content .= '<li class="youtube"><a href="http://www.youtube.com/flyplugins">' . __ ( 'Watch Fly Plugins on YouTube' , 'wp-courseware' ) . '</a></li>' ; $ content .= '</ul>' ; echo '<div class="wpcw_fly_support_news">' . $ content . '</div>' ; $ page -> closePane ( ) ; }
Show the latest news.
Show the latest news .
// Got items, so show the news