Changeset 2266393
- Timestamp:
- 03/24/2020 07:53:29 AM (6 years ago)
- Location:
- instagram-slider-widget/trunk
- Files:
-
- 5 edited
-
admin/assets/js/jr-insta-admin.js (modified) (1 diff)
-
admin/views/instagram.php (modified) (3 diffs)
-
includes/class-wis_instagram_slider.php (modified) (11 diffs)
-
instaram_slider.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
instagram-slider-widget/trunk/admin/assets/js/jr-insta-admin.js
r2253396 r2266393 261 261 _ajax_nonce: add_account_nonce.nonce 262 262 }).done( function( html ) { 263 console.log(html); 263 264 window.location.reload(); 264 265 }); -
instagram-slider-widget/trunk/admin/views/instagram.php
r2253444 r2266393 80 80 <td> 81 81 <a href="#" 82 data-item_id="<?php echo esc_attr( $profile_info['id'] ); ?>"82 data-item_id="<?php echo !empty($profile_info['id']) ? $profile_info['id'] : 0; ?>" 83 83 data-is_business="0" 84 84 class="btn btn-danger wis-delete-account"> … … 86 86 </a> 87 87 <span class="spinner" 88 id="wis-delete-spinner-<?php echo esc_attr( $profile_info['id'] ); ?>"></span>88 id="wis-delete-spinner-<?php echo !empty($profile_info['id']) ? $profile_info['id'] : 0; ?>"></span> 89 89 <?php 90 90 if(isset($_GET['access_token']) && $_GET['access_token'] === $profile_info['token']) … … 142 142 <td> 143 143 <a href="#" 144 data-item_id="<?php echo esc_attr( $profile_info['id'] ); ?>"144 data-item_id="<?php echo !empty($profile_info['id']) ? $profile_info['id'] : 0; ?>" 145 145 data-is_business="1" 146 146 class="btn btn-danger wis-delete-account"> -
instagram-slider-widget/trunk/includes/class-wis_instagram_slider.php
r2255459 r2266393 231 231 $options_linkto = $this->options_linkto; 232 232 233 $defaults = array( 233 if( count($accounts)) $s_for = 'account'; 234 else if( count($accounts_business) ) $s_for = 'account_business'; 235 else $s_for = 'username'; 236 $defaults = array( 234 237 'title' => __('Social Slider', 'instagram-slider-widget'), 235 'search_for' => count($accounts) ? 'account' : count($accounts_business) ? 'account_business' : 'username',238 'search_for' => $s_for, 236 239 'account' => '', 237 240 'account_business' => '', … … 767 770 $output .= __( 'No images found! <br> Try some other hashtag or username', 'instagram-slider-widget' ); 768 771 769 if ( ( $search == 'user' && $attachment ) ) {772 if ( ( $search == 'user' && $attachment && false ) ) { 770 773 771 774 if ( !wp_next_scheduled( 'jr_insta_cron', array( $search_for['username'], $refresh_hour, $images_number ) ) ) { … … 928 931 } // конец песочницы 929 932 else { 930 if($search !== 'hashtag' ) $account = $accounts[$images_data[0]['username']];933 if($search !== 'hashtag' && $search !== 'user') $account = $accounts[$images_data[0]['username']]; 931 934 } 932 935 … … 1243 1246 * Stores the fetched data from instagram in WordPress DB using transients 1244 1247 * 1245 * @param string$search_for Array of widget settings1248 * @param array $search_for Array of widget settings 1246 1249 * @param string $cache_hours Cache hours for transient 1247 1250 * @param string $nr_images Nr of images to fetch from instagram … … 1472 1475 $result = $result['node']; 1473 1476 if ( in_array( $result['owner']['id'], $blocked_users_array ) ) { 1474 //$nr_images++;1477 $nr_images++; 1475 1478 continue; 1476 1479 } … … 1494 1497 1495 1498 if( $this->is_blocked_by_word($blocked_words, $image_data['caption']) ) { 1496 continue; 1499 $nr_images++; 1500 continue; 1497 1501 } 1498 1502 … … 1959 1963 1960 1964 if ( !WIS_Plugin::app()->is_premium() && $this->count_accounts() >= 1) { 1961 wp_die( ' ' );1965 wp_die( 'No premium' ); 1962 1966 } 1963 1967 … … 1965 1969 WIS_Plugin::app()->updateOption( 'account_profiles_new', $user_profile ); 1966 1970 1967 wp_die( ' ' );1971 wp_die( 'Ok' ); 1968 1972 } 1969 1973 } … … 1988 1992 */ 1989 1993 public function delete_account() { 1990 if ( isset( $_POST['item_id'] ) && ! empty( $_POST['item_id'] ) &&isset( $_POST['is_business'] ) ) {1994 if ( isset( $_POST['item_id'] ) && isset( $_POST['is_business'] ) ) { 1991 1995 if ( ! current_user_can( 'manage_options' ) ) { 1992 1996 wp_die( - 1 ); … … 2000 2004 $accounts = WIS_Plugin::app()->getPopulateOption( $option_name ); 2001 2005 $accounts_new = array(); 2002 foreach($accounts as $name => $acc) { if($acc['id'] !== $_POST['item_id']) $accounts_new[$name] = $acc; } 2006 foreach($accounts as $name => $acc) { 2007 $id = isset($acc['id']) ? $acc['id'] : 0; 2008 if( $id !== (int)$_POST['item_id'] && !empty($name) ) 2009 $accounts_new[$name] = $acc; 2010 } 2003 2011 WIS_Plugin::app()->updatePopulateOption( $option_name, $accounts_new); 2004 2012 … … 2386 2394 { 2387 2395 if(empty($words) || empty($text)) return false; 2388 $words = explode( ',', $words);2389 foreach ( $words as $word ) {2390 $pos = str pos( $text, trim($word) );2396 $words_array = explode( ',', $words); 2397 foreach ( $words_array as $word ) { 2398 $pos = stripos( $text, trim($word) ); 2391 2399 if($pos !== false) return true; 2392 2400 } -
instagram-slider-widget/trunk/instaram_slider.php
r2255459 r2266393 3 3 Plugin Name: Social Slider Widget 4 4 Plugin URI: https://cm-wp.com/instagram-slider-widget 5 Version: 1.7. 45 Version: 1.7.5 6 6 Description: Social Slider Widget is a responsive slider widget that shows 12 latest images from a public Instagram user and up to 18 images from a hashtag. 7 7 Author: creativemotion -
instagram-slider-widget/trunk/readme.txt
r2255459 r2266393 104 104 105 105 == Changelog == 106 = 1.7.5 = 107 * Fixed delete empty account 108 * Compatible with PHP 7.4 109 * Other fixes 110 106 111 = 1.7.4 = 107 112 * Fixed "50 years ago" in Slider Normal and Slider Overlay templates
Note: See TracChangeset
for help on using the changeset viewer.