$value ) { $feeds_images_array[ $key ] = preg_replace( '/s150x150/', 's320x320', $value ); } $ending_array = array( 'link' => $feeds_obj['data'][0]['user']['username'], 'images' => $feeds_images_array, ); set_transient( 'blog_lite_instagram_feeds', $ending_array, 1 * HOUR_IN_SECONDS ); return $ending_array; } } class Blog_Personal_Insta_Feeds extends WP_Widget { /** * Declares the Blog_Personal_Insta_Feeds class. * */ public function __construct() { global $control_ops; $widget_ops = array( 'classname' => 'insta-section', 'description' => esc_html__( 'A widget that displays your latest Instagram photos.', 'blog-personal') ); parent::__construct('Blog_Personal_Insta_Feeds', esc_html__('Blog: Instagram Feeds', 'blog-personal'), $widget_ops, $control_ops); $this->alt_option_name = 'widget_blif'; } /** * Displays the Widget * */ function widget($args, $instance){ extract( $args ); $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; $access_token = ! empty( $instance['access_token'] ) ? $instance['access_token'] : false; $image_num = ! empty( $instance['image_num'] ) ? $instance['image_num'] : '8'; $disable_cache = ! empty( $instance['disable_cache'] ) ? '1' : '0'; ?> '; if (!empty( $title )): echo $args['before_title'] . esc_html( $title ) . $args['after_title']; endif; echo ''; $rt_feeds = Blog_Personal_Insta_Feeds( $access_token, $image_num, $disable_cache ); $count = count( $rt_feeds['images'] ); echo '
id="get_field_id('disable_cache') ); ?>" name="get_field_name('disable_cache') ); ?>" />