__( 'Instagram Photos.' , 'amazing-widgets') )
);
}
public function form($instance) {
$defaults = array(
'title' => __('Instagram', 'amazing-widgets'),
'photos_of' => __('username', 'amazing-widgets'),
'instagram_tag' => '',
'photo_count' => 6,
);
$instance = wp_parse_args( (array) $instance, $defaults );
?>
Amazing Widgets page', 'amazing-widgets'); ?>
id.$postSalt));
function gabfire_instagramphoto($value)
{
$time1 = date("d/m/y", $value["created_time"]);
$time2 = date("F j, Y", $value['caption']['created_time']);
$time3 = date("F j, Y", strtotime($time2 . " +1 days"));
$nickname = $value["user"]["username"];
$user_avatar = $value["user"]["profile_picture"];
$pic_text = $value['caption']['text'];
$like_count = $value['likes']['count'];
$comment_count = $value['comments']['count'];
$thumb = $value["images"]["thumbnail"]["url"];
$link = $value["link"];
return "";
}
if ($photos_of == 'username')
{
$contents = file_get_contents("https://api.instagram.com/v1/users/$user_id/media/recent/?access_token=$accesstoken&count=$photo_count");
}
else {
$contents = file_get_contents("https://api.instagram.com/v1/tags/$instagram_tag/media/recent?client_id=$clientid&count=$photo_count");
}
$obj = json_decode($contents, true);
foreach ($obj["data"] as $value)
{
echo gabfire_instagramphoto( $value );
}
echo '';
echo $args['after_widget'];
}
}
// Register the widget
add_action('widgets_init',
create_function('', 'return register_widget("Aw_Instagram");')
);