esc_html__( 'Displays your latest Dribbble photos.', 'baskerville' ) ) ); } function widget( $args, $instance ) { $widget_title = apply_filters( 'widget_title', $instance['widget_title'] ); $dribbble_username = $instance['dribbble_username']; $dribbble_number = $instance['dribbble_number']; $unique_id = $args['widget_id']; echo $args['before_widget']; if ( ! empty( $widget_title ) ) { echo $args['before_title'] . $widget_title . $args['after_title']; } $rss = fetch_feed( "http://dribbble.com/players/$dribbble_username/shots.rss" ); if ( ! function_exists( 'return_1800' ) ) : function return_1800( $seconds ) { // change the default feed cache recreation period to 30 min return 1800; } add_filter( 'wp_feed_cache_transient_lifetime', 'return_1800' ); endif; if ( ! is_wp_error( $rss ) ) : $items = $rss->get_items( 0, $rss->get_item_quantity( $dribbble_number ) ); endif; remove_filter( 'wp_feed_cache_transient_lifetime', 'return_1800' ); if ( ! empty( $items ) ): ?>
get_title(); $link = $item->get_permalink(); $description = $item->get_description(); preg_match( '/src=\"(http.*(jpg|jpeg|gif|png))/', $description, $image_url ); // Prevent outputting an error if we can't find the image if ( 0 !== count( $image_url ) ): $image = $image_url[1]; endif; ?> <?php echo esc_attr( $title );?>