Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ( $images as $image ) {
- $image['thumbnail_src'] = preg_replace( '/^https?\:/i', '', $image['thumbnail_src'] );
- $image['display_src'] = preg_replace( '/^https?\:/i', '', $image['display_src'] );
- $image['thumbnail'] = preg_replace('#^https?:#', '', isset( $image['thumbnail_resources'][0]['src'] ) ? $image['thumbnail_resources'][0]['src'] : $image['thumbnail_src'] );
- $image['small'] = preg_replace('#^https?:#', '', isset( $image['thumbnail_resources'][2]['src'] ) ? $image['thumbnail_resources'][2]['src'] : $image['thumbnail_src'] );
- $image['large'] = preg_replace('#^https?:#', '', isset( $image['thumbnail_resources'][3]['src'] ) ? $image['thumbnail_resources'][3]['src'] : $image['thumbnail_src'] );
- if ( $image['is_video'] == true ) {
- $type = 'video';
- }
- else {
- $type = 'image';
- }
- $caption = esc_html__( 'Instagram Image', 'rock-star' );
- if ( ! empty( $image['caption'] ) ) {
- $caption = $image['caption'];
- }
- $instagram[] = array(
- 'description' => $caption,
- 'link' => '//instagram.com/p/' . $image['code'],
- 'time' => $image['date'],
- 'comments' => $image['comments']['count'],
- 'likes' => $image['likes']['count'],
- 'thumbnail' => $image['thumbnail'],
- 'small' => $image['small'],
- 'large' => $image['large'],
- 'original' => $image['display_src'],
- 'type' => $type
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment