Version Description
- Bug fixing for invalid user credentials for latest instagram feeds.
- Addition of the instagram widget with profile details.
Download this release
Release Info
Developer | Access Keys |
Plugin | AccessPress Instagram Feed |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- accesspress-instagram-feed.php +4 -2
- css/frontend.css +108 -0
- inc/backend/boards/display-settings.php +1 -1
- inc/backend/instagram.php +37 -0
- inc/backend/save-settings.php +2 -5
- inc/backend/widgetside.php +193 -0
- inc/frontend/shortcode.php +27 -7
- readme.txt +9 -5
accesspress-instagram-feed.php
CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
|
|
4 |
Plugin name: AccessPress Instagram Feed
|
5 |
Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed/
|
6 |
Description: A plugin to add various instagram widgets with dynamic configuration options.
|
7 |
-
Version: 1.0.
|
8 |
Author: AccessPress Themes
|
9 |
Author URI: http://accesspressthemes.com
|
10 |
Text Domain:if-feed
|
@@ -14,7 +14,7 @@ License: GPLv2 or later
|
|
14 |
|
15 |
//Decleration of the necessary constants for plugin
|
16 |
if(!defined ( 'APIF_VERSION' ) ){
|
17 |
-
define ( 'APIF_VERSION', '1.0.
|
18 |
}
|
19 |
|
20 |
if( !defined( 'APIF_IMAGE_DIR' ) ){
|
@@ -43,6 +43,7 @@ if(!defined('APIF_TEXT_DOMAIN')){
|
|
43 |
* Register of widgets
|
44 |
**/
|
45 |
include_once('inc/backend/widget.php');
|
|
|
46 |
|
47 |
if (!class_exists('IF_Class')) {
|
48 |
|
@@ -158,6 +159,7 @@ class IF_Class {
|
|
158 |
*/
|
159 |
function register_apif_widget() {
|
160 |
register_widget('APIF_Widget');
|
|
|
161 |
}
|
162 |
}
|
163 |
$sc_object = new IF_Class(); //initialization of plugin
|
4 |
Plugin name: AccessPress Instagram Feed
|
5 |
Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-instagram-feed/
|
6 |
Description: A plugin to add various instagram widgets with dynamic configuration options.
|
7 |
+
Version: 1.0.2
|
8 |
Author: AccessPress Themes
|
9 |
Author URI: http://accesspressthemes.com
|
10 |
Text Domain:if-feed
|
14 |
|
15 |
//Decleration of the necessary constants for plugin
|
16 |
if(!defined ( 'APIF_VERSION' ) ){
|
17 |
+
define ( 'APIF_VERSION', '1.0.2' );
|
18 |
}
|
19 |
|
20 |
if( !defined( 'APIF_IMAGE_DIR' ) ){
|
43 |
* Register of widgets
|
44 |
**/
|
45 |
include_once('inc/backend/widget.php');
|
46 |
+
include_once('inc/backend/widgetside.php');
|
47 |
|
48 |
if (!class_exists('IF_Class')) {
|
49 |
|
159 |
*/
|
160 |
function register_apif_widget() {
|
161 |
register_widget('APIF_Widget');
|
162 |
+
register_widget('APIF_SideWidget');
|
163 |
}
|
164 |
}
|
165 |
$sc_object = new IF_Class(); //initialization of plugin
|
css/frontend.css
CHANGED
@@ -1,5 +1,22 @@
|
|
1 |
|
2 |
/*******************************Mosaic View layout*************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/* ---- Thumb view style ---- */
|
4 |
.thumb-view .thumb-elem{
|
5 |
position: relative;
|
@@ -176,4 +193,95 @@ span.instagram_like_count {
|
|
176 |
.instagram_imge_like .count{
|
177 |
display: block;
|
178 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
/*******************************Mosaic View layout*************************************/
|
3 |
+
.clearfix:before,
|
4 |
+
.clearfix:after{
|
5 |
+
content: "";
|
6 |
+
display: table;
|
7 |
+
}
|
8 |
+
.clearfix:after{
|
9 |
+
clear: both;
|
10 |
+
}
|
11 |
+
.table-outer{
|
12 |
+
display: table;
|
13 |
+
width:100%;
|
14 |
+
height: 100%;
|
15 |
+
}
|
16 |
+
.table-inner{
|
17 |
+
display: table-cell;
|
18 |
+
vertical-align: middle;
|
19 |
+
}
|
20 |
/* ---- Thumb view style ---- */
|
21 |
.thumb-view .thumb-elem{
|
22 |
position: relative;
|
193 |
.instagram_imge_like .count{
|
194 |
display: block;
|
195 |
}
|
196 |
+
.instagram-widget {
|
197 |
+
margin-left: -3%;
|
198 |
+
padding: 3%;
|
199 |
+
}
|
200 |
+
.instagram-widget li {
|
201 |
+
width: 33.33%;
|
202 |
+
float: left;
|
203 |
+
padding-left: 3%;
|
204 |
+
}
|
205 |
|
206 |
+
.widget-title-insta {
|
207 |
+
text-align: center;
|
208 |
+
font-family: 'Playfair Display', serif;
|
209 |
+
color: #d28d56;
|
210 |
+
font-size: 20px;
|
211 |
+
line-height: normal;
|
212 |
+
position: relative;
|
213 |
+
}
|
214 |
+
.profile{
|
215 |
+
background:#295988;
|
216 |
+
padding:5px;
|
217 |
+
}
|
218 |
+
.profile-img{
|
219 |
+
float:left;
|
220 |
+
width:40px;
|
221 |
+
height:40px;
|
222 |
+
border:1px solid #ffffff;
|
223 |
+
overflow: hidden;
|
224 |
+
border-radius: 100%;
|
225 |
+
}
|
226 |
+
.profile-img img{
|
227 |
+
width:100%;
|
228 |
+
height:100%;
|
229 |
+
border-radius: 100%;
|
230 |
+
}
|
231 |
+
.profile-name{
|
232 |
+
text-align:center;
|
233 |
+
padding-left:45px;
|
234 |
+
font-size:16px;
|
235 |
+
line-height:40px;
|
236 |
+
font-weight:bold;
|
237 |
+
text-transform: uppercase;
|
238 |
+
color:#ffffff;
|
239 |
+
}
|
240 |
+
.profile-follow{
|
241 |
+
background: #F8F8F8;
|
242 |
+
padding:5px;
|
243 |
+
border-bottom:1px solid #eeeeee;
|
244 |
+
position:relative;
|
245 |
+
}
|
246 |
+
.profile-follow>div{
|
247 |
+
float:left;
|
248 |
+
width:25%;
|
249 |
+
text-align:center;
|
250 |
+
font-weight:bold;
|
251 |
+
font-size:12px;
|
252 |
+
color:#295988;
|
253 |
+
}
|
254 |
+
.profile-follow>div>span{
|
255 |
+
display: block;
|
256 |
+
font-weight:normal;
|
257 |
+
font-size:10px;
|
258 |
+
color:#999999;
|
259 |
+
text-transform: capitalize;
|
260 |
+
}
|
261 |
+
.profile-follow .follow{
|
262 |
+
position:absolute;
|
263 |
+
top:0;
|
264 |
+
right:0;
|
265 |
+
width:25%;
|
266 |
+
height:100%;
|
267 |
+
padding:5px;
|
268 |
+
}
|
269 |
+
.follow-inner {
|
270 |
+
height: 100%;
|
271 |
+
}
|
272 |
+
.profile-follow .follow a{
|
273 |
+
display: inline-block;
|
274 |
+
width:100%;
|
275 |
+
padding:5px 0px;
|
276 |
+
background:#275A89;
|
277 |
+
color:#ffffff;
|
278 |
+
border:1px solid #275A89;
|
279 |
+
text-transform: capitalize;
|
280 |
+
font-weight:bold;
|
281 |
+
font-size:10px;
|
282 |
+
}
|
283 |
+
.profile-follow .follow a:hover{
|
284 |
+
background:transparent;
|
285 |
+
color:#275A89;
|
286 |
+
border:1px solid #275A89;
|
287 |
+
}
|
inc/backend/boards/display-settings.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<div class="apsc-option-field">
|
6 |
<div class="apsc-option-inner-wrapper">
|
7 |
<label style="float:left;"><?php _e('Image Like', 'if-feed') ?></label>
|
8 |
-
<div class="apsc-option-field"><input type="checkbox" name="instagram[active]" value="1" class="apsc-counter-activation-trigger" <?php
|
9 |
</div>
|
10 |
</div>
|
11 |
</div>
|
5 |
<div class="apsc-option-field">
|
6 |
<div class="apsc-option-inner-wrapper">
|
7 |
<label style="float:left;"><?php _e('Image Like', 'if-feed') ?></label>
|
8 |
+
<div class="apsc-option-field"><input type="checkbox" name="instagram[active]" value="1" class="apsc-counter-activation-trigger" <?php checked( $apif_settings['active'], '1'); ?>/><?php _e('Show/Hide', 'if-feed'); ?></div>
|
9 |
</div>
|
10 |
</div>
|
11 |
</div>
|
inc/backend/instagram.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class InstaWCD{
|
3 |
+
function userID(){
|
4 |
+
$username = strtolower($this->username); // sanitization
|
5 |
+
$token = $this->access_token;
|
6 |
+
|
7 |
+
if(!empty($username) && !empty($token)) {
|
8 |
+
|
9 |
+
$url = "https://api.instagram.com/v1/users/search?q=".$username."&access_token=".$token;
|
10 |
+
|
11 |
+
$get = wp_remote_get($url);
|
12 |
+
$response = wp_remote_retrieve_body( $get );
|
13 |
+
$json = json_decode($response);
|
14 |
+
|
15 |
+
foreach($json->data as $user){
|
16 |
+
if($user->username == $username){
|
17 |
+
return $user->id;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
return '00000000'; // return this if nothing is found
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
function userMedia(){
|
26 |
+
|
27 |
+
$url = 'https://api.instagram.com/v1/users/'.$this->userID().'/media/recent/?access_token='.$this->access_token;
|
28 |
+
|
29 |
+
$content = wp_remote_get($url);
|
30 |
+
$response = wp_remote_retrieve_body( $content );
|
31 |
+
return $json = json_decode($response, true);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
$insta = new InstaWCD();
|
35 |
+
$insta->username = $username;
|
36 |
+
$insta->access_token = $access_token;
|
37 |
+
?>
|
inc/backend/save-settings.php
CHANGED
@@ -26,11 +26,8 @@ $apif_settings['username'] = $username;
|
|
26 |
$apif_settings['access_token'] = $access_token;
|
27 |
$apif_settings['instagram_mosaic'] = isset($instagram_mosaic)?$instagram_mosaic:'mosaic';
|
28 |
$apif_settings['user_id'] = $user_id;
|
29 |
-
$apif_settings['active'] = $active;
|
30 |
-
|
31 |
update_option('apif_settings', $apif_settings);
|
32 |
-
|
33 |
$_SESSION['apif_message'] = __('Settings Saved Successfully','if-feed');
|
34 |
wp_redirect(admin_url().'admin.php?page=if-instagram-feed');
|
35 |
-
exit();
|
36 |
-
?>
|
26 |
$apif_settings['access_token'] = $access_token;
|
27 |
$apif_settings['instagram_mosaic'] = isset($instagram_mosaic)?$instagram_mosaic:'mosaic';
|
28 |
$apif_settings['user_id'] = $user_id;
|
29 |
+
$apif_settings['active'] = isset($active) ? $active : ' ';
|
|
|
30 |
update_option('apif_settings', $apif_settings);
|
|
|
31 |
$_SESSION['apif_message'] = __('Settings Saved Successfully','if-feed');
|
32 |
wp_redirect(admin_url().'admin.php?page=if-instagram-feed');
|
33 |
+
exit();
|
|
inc/backend/widgetside.php
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined('ABSPATH') or die("No script kiddies please!");
|
3 |
+
/**
|
4 |
+
* Adds AccessPress Instagram Feed Widget
|
5 |
+
*/
|
6 |
+
class APIF_SideWidget extends WP_Widget {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Register widget with WordPress.
|
10 |
+
*/
|
11 |
+
function __construct() {
|
12 |
+
parent::__construct(
|
13 |
+
'apif_sidewidget', // Base ID
|
14 |
+
__('AP : Instagram Feeds', 'if-feed'), // Name
|
15 |
+
array('description' => __('AccessPress Instagram Feeds', 'if-feed')) // Args
|
16 |
+
);
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Front-end display of widget.
|
21 |
+
*
|
22 |
+
* @see WP_Widget::widget()
|
23 |
+
*
|
24 |
+
* @param array $args Widget arguments.
|
25 |
+
* @param array $instance Saved values from database.
|
26 |
+
*/
|
27 |
+
public function widget($args, $instance) {
|
28 |
+
|
29 |
+
echo $args['before_widget'];
|
30 |
+
if (!empty($instance['title'])) {
|
31 |
+
echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
|
32 |
+
}
|
33 |
+
|
34 |
+
$instagram_num_img = isset($instance['instagram_num_img'])?$instance['instagram_num_img']:'12';
|
35 |
+
$instance_post = (isset($instance['instance_post']) && $instance['instance_post']==1)?'true':'false';
|
36 |
+
$instance_followers = (isset($instance['instance_followers']) && $instance['instance_followers']==1)?'true':'false';
|
37 |
+
$instance_following = (isset($instance['instance_following']) && $instance['instance_following']==1)?'true':'false';
|
38 |
+
$instance_follow = (isset($instance['instance_follow']) && $instance['instance_follow']==1)?'true':'false';
|
39 |
+
|
40 |
+
|
41 |
+
global $apif_settings, $insta;
|
42 |
+
$username = !empty($apif_settings['username']) ? $apif_settings['username'] : '';
|
43 |
+
$user_id = !empty($apif_settings['user_id']) ? $apif_settings['user_id'] : '';
|
44 |
+
$social_profile_url = 'https://instagram.com/' . $username;
|
45 |
+
$access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
|
46 |
+
|
47 |
+
$api_url = 'https://api.instagram.com/v1/users/' . $user_id . '?access_token=' . $access_token;
|
48 |
+
$connection = wp_remote_get($api_url);
|
49 |
+
$response = json_decode($connection['body'], true);
|
50 |
+
?>
|
51 |
+
<div class="instagram-header">
|
52 |
+
<header class="profile clearfix">
|
53 |
+
<div class="profile-img">
|
54 |
+
<img src="<?php echo $response['data']['profile_picture']; ?>"/>
|
55 |
+
</div>
|
56 |
+
<div class="profile-name">
|
57 |
+
<?php echo $response['data']['full_name']; ?>
|
58 |
+
</div>
|
59 |
+
</header>
|
60 |
+
<header class="profile-follow clearfix">
|
61 |
+
<div class="post">
|
62 |
+
<?php echo $response['data']['counts']['media']; ?>
|
63 |
+
<span>post</span>
|
64 |
+
</div>
|
65 |
+
<div class="followers">
|
66 |
+
<?php echo $response['data']['counts']['followed_by']; ?>
|
67 |
+
<span>followers</span>
|
68 |
+
</div>
|
69 |
+
<div class="following">
|
70 |
+
<?php echo $response['data']['counts']['follows']; ?>
|
71 |
+
<span>following</span>
|
72 |
+
</div>
|
73 |
+
<div class="follow">
|
74 |
+
<div class="follow-inner">
|
75 |
+
<div class="table-outer">
|
76 |
+
<div class="table-inner">
|
77 |
+
<a href="#">follow</a>
|
78 |
+
<?php //echo $response['data']['link']; ?>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
</header>
|
84 |
+
</div>
|
85 |
+
<?php
|
86 |
+
|
87 |
+
$count = $instagram_num_img;
|
88 |
+
require_once(dirname(__FILE__) . '/instagram.php');
|
89 |
+
$ins_media = $insta->userMedia();
|
90 |
+
$j = 0;
|
91 |
+
if(isset($ins_media['meta']['error_message'])){
|
92 |
+
?>
|
93 |
+
<h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
|
94 |
+
<?php
|
95 |
+
} else if (is_array($ins_media['data']) || is_object($ins_media['data']))
|
96 |
+
{
|
97 |
+
echo '<ul class="instagram-widget clear">';
|
98 |
+
foreach ($ins_media['data'] as $vm)
|
99 |
+
{
|
100 |
+
if ($count == $j) {
|
101 |
+
break;
|
102 |
+
}
|
103 |
+
$j++;
|
104 |
+
$img = $vm['images']['thumbnail']['url'];
|
105 |
+
?>
|
106 |
+
<li><img class="the-thumb" src="<?php echo esc_url($img); ?>"></li>
|
107 |
+
<?php
|
108 |
+
}
|
109 |
+
echo '</ul>';
|
110 |
+
}
|
111 |
+
echo $args['after_widget'];
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Back-end widget form.
|
116 |
+
*
|
117 |
+
* @see WP_Widget::form()
|
118 |
+
*
|
119 |
+
* @param array $instance Previously saved values from database.
|
120 |
+
*/
|
121 |
+
public function form($instance) {
|
122 |
+
$title = isset($instance['title'])?$instance['title']:'';
|
123 |
+
$instagram_num_img = isset($instance['instagram_num_img'])?$instance['instagram_num_img']:'';
|
124 |
+
|
125 |
+
$instance_post = isset($instance['instance_post'])?$instance['instance_post']:'';
|
126 |
+
$instance_followers = isset($instance['instance_followers'])?$instance['instance_followers']:'';
|
127 |
+
$instance_following = isset($instance['instance_following'])?$instance['instance_following']:'';
|
128 |
+
$instance_follow = isset($instance['instance_follow'])?$instance['instance_follow']:'';
|
129 |
+
|
130 |
+
?>
|
131 |
+
<p>
|
132 |
+
|
133 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'if-feed'); ?></label>
|
134 |
+
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>"/>
|
135 |
+
</p>
|
136 |
+
<p>
|
137 |
+
|
138 |
+
<label for="<?php echo $this->get_field_id('instagram_num_img'); ?>"><?php _e('Number of Image:', 'if-feed'); ?></label>
|
139 |
+
<select class="widefat" id="<?php echo $this->get_field_id('instagram_num_img'); ?>" name="<?php echo $this->get_field_name('instagram_num_img'); ?>" >
|
140 |
+
<option value="">Default</option>
|
141 |
+
<?php for($i=1;$i<=21;$i++){
|
142 |
+
?>
|
143 |
+
<option value="<?php echo $i;?>" <?php selected($instagram_num_img,''.$i);?>><?php echo $i; ?></option>
|
144 |
+
<?php
|
145 |
+
}?>
|
146 |
+
</select>
|
147 |
+
</p>
|
148 |
+
<p>
|
149 |
+
<label for="<?php echo $this->get_field_id('instance_post'); ?>"><?php _e('Display Instagram Post :', 'if-feed'); ?></label>
|
150 |
+
<input class="widefat" id="<?php echo $this->get_field_id('instance_post'); ?>" name="<?php echo $this->get_field_name('instance_post'); ?>" type="checkbox" value="1" <?php checked($instance_post,true);?>/>
|
151 |
+
</p>
|
152 |
+
|
153 |
+
<p>
|
154 |
+
<label for="<?php echo $this->get_field_id('instance_followers'); ?>"><?php _e('Display Followers :', 'if-feed'); ?></label>
|
155 |
+
<input class="widefat" id="<?php echo $this->get_field_id('instance_followers'); ?>" name="<?php echo $this->get_field_name('instance_followers'); ?>" type="checkbox" value="1" <?php checked($instance_followers,true);?>/>
|
156 |
+
</p>
|
157 |
+
|
158 |
+
<p>
|
159 |
+
<label for="<?php echo $this->get_field_id('instance_following'); ?>"><?php _e('Display Instagram Following :', 'if-feed'); ?></label>
|
160 |
+
<input class="widefat" id="<?php echo $this->get_field_id('instance_following'); ?>" name="<?php echo $this->get_field_name('instance_following'); ?>" type="checkbox" value="1" <?php checked($instance_following,true);?>/>
|
161 |
+
</p>
|
162 |
+
|
163 |
+
<p>
|
164 |
+
<label for="<?php echo $this->get_field_id('instance_follow'); ?>"><?php _e('Display Instagram Follow Button :', 'if-feed'); ?></label>
|
165 |
+
<input class="widefat" id="<?php echo $this->get_field_id('instance_follow'); ?>" name="<?php echo $this->get_field_name('instance_follow'); ?>" type="checkbox" value="1" <?php checked($instance_follow,true);?>/>
|
166 |
+
</p>
|
167 |
+
<?php
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Sanitize widget form values as they are saved.
|
172 |
+
*
|
173 |
+
* @see WP_Widget::update()
|
174 |
+
*
|
175 |
+
* @param array $new_instance Values just sent to be saved.
|
176 |
+
* @param array $old_instance Previously saved values from database.
|
177 |
+
*
|
178 |
+
* @return array Updated safe values to be saved.
|
179 |
+
*/
|
180 |
+
public function update($new_instance, $old_instance) {
|
181 |
+
$instance = array();
|
182 |
+
$instance['title'] = (!empty($new_instance['title']) ) ? sanitize_text_field($new_instance['title']) : '';
|
183 |
+
$instance['instagram_num_img'] = (!empty($new_instance['instagram_num_img']) ) ? sanitize_text_field($new_instance['instagram_num_img']) : '';
|
184 |
+
|
185 |
+
$instance['instance_post'] = (!empty($new_instance['instance_post']) ) ? sanitize_text_field($new_instance['instance_post']) : '';
|
186 |
+
$instance['instance_followers'] = (!empty($new_instance['instance_followers']) ) ? sanitize_text_field($new_instance['instance_followers']) : '';
|
187 |
+
$instance['instance_following'] = (!empty($new_instance['instance_following']) ) ? sanitize_text_field($new_instance['instance_following']) : '';
|
188 |
+
$instance['instance_follow'] = (!empty($new_instance['instance_follow']) ) ? sanitize_text_field($new_instance['instance_follow']) : '';
|
189 |
+
return $instance;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
// class APS_PRO_Widget
|
193 |
+
?>
|
inc/frontend/shortcode.php
CHANGED
@@ -12,7 +12,7 @@ function ap_instagram_feed() {
|
|
12 |
$username = !empty($apif_settings['username']) ? $apif_settings['username'] : ''; // your username
|
13 |
$access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
|
14 |
$layout = $apif_settings['instagram_mosaic'];
|
15 |
-
$image_like = $apif_settings['active'];
|
16 |
$count = 7; // number of images to show
|
17 |
require_once(dirname(__FILE__) . '/instagram.php');
|
18 |
|
@@ -23,8 +23,12 @@ function ap_instagram_feed() {
|
|
23 |
<?php
|
24 |
$ins_media = $insta->userMedia();
|
25 |
$i = 1;
|
26 |
-
$j = 0;
|
27 |
-
if
|
|
|
|
|
|
|
|
|
28 |
foreach ($ins_media['data'] as $vm):
|
29 |
if ($count == $j) {
|
30 |
break;
|
@@ -108,7 +112,11 @@ function ap_instagram_feed() {
|
|
108 |
<?php
|
109 |
$ins_media_slider = $insta->userMedia();
|
110 |
$j = 0;
|
111 |
-
|
|
|
|
|
|
|
|
|
112 |
foreach ($ins_media_slider['data'] as $vm):
|
113 |
if ($count == $j) {
|
114 |
break;
|
@@ -160,7 +168,11 @@ function ap_instagram_widget() {
|
|
160 |
$ins_media = $insta->userMedia();
|
161 |
$i = 1;
|
162 |
$j = 0;
|
163 |
-
if
|
|
|
|
|
|
|
|
|
164 |
foreach ($ins_media['data'] as $vm):
|
165 |
if ($count == $j) {
|
166 |
break;
|
@@ -241,7 +253,11 @@ function ap_instagram_mosaic_light() {
|
|
241 |
$ins_media_masaic = $insta->userMedia();
|
242 |
$i = 1;
|
243 |
$j = 0;
|
244 |
-
if
|
|
|
|
|
|
|
|
|
245 |
foreach ($ins_media_masaic['data'] as $vm):
|
246 |
if ($count == $j) {
|
247 |
break;
|
@@ -322,7 +338,11 @@ function ap_instagram_slider() {
|
|
322 |
<?php
|
323 |
$ins_media_slider = $insta->userMedia();
|
324 |
$j = 0;
|
325 |
-
if
|
|
|
|
|
|
|
|
|
326 |
foreach ($ins_media_slider['data'] as $vm):
|
327 |
if ($count == $j) {
|
328 |
break;
|
12 |
$username = !empty($apif_settings['username']) ? $apif_settings['username'] : ''; // your username
|
13 |
$access_token = !empty($apif_settings['access_token']) ? $apif_settings['access_token'] : '';
|
14 |
$layout = $apif_settings['instagram_mosaic'];
|
15 |
+
$image_like = $apif_settings['active'];
|
16 |
$count = 7; // number of images to show
|
17 |
require_once(dirname(__FILE__) . '/instagram.php');
|
18 |
|
23 |
<?php
|
24 |
$ins_media = $insta->userMedia();
|
25 |
$i = 1;
|
26 |
+
$j = 0;
|
27 |
+
if(isset($ins_media['meta']['error_message'])){
|
28 |
+
?>
|
29 |
+
<h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
|
30 |
+
<?php
|
31 |
+
}else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
|
32 |
foreach ($ins_media['data'] as $vm):
|
33 |
if ($count == $j) {
|
34 |
break;
|
112 |
<?php
|
113 |
$ins_media_slider = $insta->userMedia();
|
114 |
$j = 0;
|
115 |
+
if(isset($ins_media['meta']['error_message'])){
|
116 |
+
?>
|
117 |
+
<h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
|
118 |
+
<?php
|
119 |
+
} if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) {
|
120 |
foreach ($ins_media_slider['data'] as $vm):
|
121 |
if ($count == $j) {
|
122 |
break;
|
168 |
$ins_media = $insta->userMedia();
|
169 |
$i = 1;
|
170 |
$j = 0;
|
171 |
+
if(isset($ins_media['meta']['error_message'])){
|
172 |
+
?>
|
173 |
+
<h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
|
174 |
+
<?php
|
175 |
+
}else if (is_array($ins_media['data']) || is_object($ins_media['data'])) {
|
176 |
foreach ($ins_media['data'] as $vm):
|
177 |
if ($count == $j) {
|
178 |
break;
|
253 |
$ins_media_masaic = $insta->userMedia();
|
254 |
$i = 1;
|
255 |
$j = 0;
|
256 |
+
if(isset($ins_media['meta']['error_message'])){
|
257 |
+
?>
|
258 |
+
<h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
|
259 |
+
<?php
|
260 |
+
}else if (is_array($ins_media_masaic['data']) || is_object($ins_media_masaic['data'])) {
|
261 |
foreach ($ins_media_masaic['data'] as $vm):
|
262 |
if ($count == $j) {
|
263 |
break;
|
338 |
<?php
|
339 |
$ins_media_slider = $insta->userMedia();
|
340 |
$j = 0;
|
341 |
+
if(isset($ins_media['meta']['error_message'])){
|
342 |
+
?>
|
343 |
+
<h1 class="widget-title-insta"><span><?php echo $ins_media['meta']['error_message']; ?></span></h1>
|
344 |
+
<?php
|
345 |
+
}else if (is_array($ins_media_slider['data']) || is_object($ins_media_slider['data'])) {
|
346 |
foreach ($ins_media_slider['data'] as $vm):
|
347 |
if ($count == $j) {
|
348 |
break;
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Access Keys
|
|
3 |
Tags: instagram, instagram feed, instagram tag, instagram slider, instagarm mosaic view, instagarm mosaic layout, instagram lightbox, social media instagram, social network, masonry layout, masonry lightbox, instagarm masonry view
|
4 |
Donate link: http://accesspressthemes.com/donation/
|
5 |
Requires at least: 3.8
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -95,12 +95,16 @@ Once you install the plugin , you can check some general documentation about how
|
|
95 |
5. Backend Display Settings Section
|
96 |
|
97 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
= 1.0.0 =
|
99 |
* Plugin submitted to http://wordpress.org for review and approval
|
100 |
* Plugin approved in http://wordpress.org and comitted in plugin repository
|
101 |
|
102 |
-
= 1.0.1 =
|
103 |
-
* Add instagram image like count Enable/Disable Option in backend.
|
104 |
-
|
105 |
== Upgrade Notice ==
|
106 |
There is an update available for the AccessPress Instagram Feed Plugin. Please update to receive new updates and bug fixes.
|
3 |
Tags: instagram, instagram feed, instagram tag, instagram slider, instagarm mosaic view, instagarm mosaic layout, instagram lightbox, social media instagram, social network, masonry layout, masonry lightbox, instagarm masonry view
|
4 |
Donate link: http://accesspressthemes.com/donation/
|
5 |
Requires at least: 3.8
|
6 |
+
Tested up to: 4.3
|
7 |
+
Stable tag: 1.0.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
95 |
5. Backend Display Settings Section
|
96 |
|
97 |
== Changelog ==
|
98 |
+
= 1.0.2 =
|
99 |
+
* Bug fixing for invalid user credentials for latest instagram feeds.
|
100 |
+
* Addition of the instagram widget with profile details.
|
101 |
+
|
102 |
+
= 1.0.1 =
|
103 |
+
* Add instagram image like count Enable/Decable Option in backend.
|
104 |
+
|
105 |
= 1.0.0 =
|
106 |
* Plugin submitted to http://wordpress.org for review and approval
|
107 |
* Plugin approved in http://wordpress.org and comitted in plugin repository
|
108 |
|
|
|
|
|
|
|
109 |
== Upgrade Notice ==
|
110 |
There is an update available for the AccessPress Instagram Feed Plugin. Please update to receive new updates and bug fixes.
|