Changeset 1327415
- Timestamp:
- 01/13/2016 11:14:56 AM (10 years ago)
- Location:
- flickr-field-for-advanced-custom-fields/trunk
- Files:
-
- 6 edited
-
acf-flickr-v4.php (modified) (4 diffs)
-
acf-flickr-v5.php (modified) (3 diffs)
-
acf-flickr.php (modified) (1 diff)
-
css/options.css (modified) (1 diff)
-
js/options.js (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flickr-field-for-advanced-custom-fields/trunk/acf-flickr-v4.php
r1325810 r1327415 25 25 $this->defaults = array( 26 26 // add defaults here to merge into your field. 27 'flickr_api_key' => '', 28 'flickr_user_id' => '', 29 'flickr_content_type' => 'sets', 30 'flickr_private_mode' => 0, 31 'flickr_secret_key' => '', 32 'flickr_private_token' => '', 33 'flickr_sets_amount' => '9999', 34 'flickr_max_selected' => '0', 35 'flickr_thumb_size' => 'square', 36 'flickr_large_size' => 'large_1024', 37 'flickr_show_limit' => '500', 38 'flickr_cache_enabled' => '1', 39 'flickr_cache_duration' => '168', 27 'flickr_api_key' => '', 28 'flickr_user_id' => '', 29 'flickr_content_type' => 'sets', 30 'flickr_private_mode' => 0, 31 'flickr_secret_key' => '', 32 'flickr_private_token' => '', 33 'flickr_sets_amount' => '9999', 34 'flickr_max_selected' => '0', 35 'flickr_thumb_size' => 'square', 36 'flickr_large_size' => 'large_1024', 37 'flickr_show_limit' => '500', 38 'flickr_cache_enabled' => '1', 39 'flickr_admin_cache_duration' => '30', 40 'flickr_cache_duration' => '168', 40 41 ); 41 42 … … 273 274 <tr class="field_option field_option_<?php echo $this->name; ?>" data-name="flickr_cache_duration"> 274 275 <td class="label"> 275 <label><?php _e(' Cache duration','acf-flickr'); ?></label>276 <p class="description"><?php _e('The time your cache may last in minutes.', 'acf-flickr');?></p>276 <label><?php _e('Front-end cache duration','acf-flickr'); ?></label> 277 <p class="description"><?php _e('The time your front-end cache may last in minutes (how visitors view the photos).', 'acf-flickr');?></p> 277 278 </td> 278 279 <td> … … 282 283 'name' => 'fields['.$key.'][flickr_cache_duration]', 283 284 'value' => $field['flickr_cache_duration'], 285 )); 286 ?> 287 </td> 288 </tr> 289 <tr class="field_option field_option_<?php echo $this->name; ?>" data-name="flickr_cache_duration"> 290 <td class="label"> 291 <label><?php _e('Admin cache duration','acf-flickr'); ?></label> 292 <p class="description"><?php _e('The time your admin cache may last in minutes. This is usually lower than the front-end cache duration.', 'acf-flickr');?></p> 293 </td> 294 <td> 295 <?php 296 do_action('acf/create_field', array( 297 'type' => 'text', 298 'name' => 'fields['.$key.'][flickr_admin_cache_duration]', 299 'value' => $field['flickr_admin_cache_duration'], 284 300 )); 285 301 ?> … … 399 415 } 400 416 if (is_writeable($cache_dir) && $field['flickr_cache_enabled'] == 1) { 401 $duration = $field['flickr_cache_duration'] * 60 * 60; 417 $admin_cache = isset($field['flickr_admin_cache_duration']) ? $field['flickr_admin_cache_duration'] : $field['flickr_cache_duration']; 418 $duration = $admin_cache * 60 * 60; 402 419 $f->enableCache('fs', $cache_dir, $duration); 403 420 } -
flickr-field-for-advanced-custom-fields/trunk/acf-flickr-v5.php
r1327340 r1327415 44 44 45 45 $this->defaults = array( 46 'flickr_api_key' => '', 47 'flickr_user_id' => '', 48 'flickr_private_mode' => 0, 49 'flickr_secret_key' => '', 50 'flickr_private_token' => '', 51 'flickr_content_type' => 'sets', 52 'flickr_sets_amount' => '9999', 53 'flickr_max_selected' => '0', 54 'flickr_show_limit' => '500', 55 'flickr_thumb_size' => 'square', 56 'flickr_large_size' => 'large_1024', 57 'flickr_cache_enabled' => '1', 58 'flickr_cache_duration' => '168', 46 'flickr_api_key' => '', 47 'flickr_user_id' => '', 48 'flickr_private_mode' => 0, 49 'flickr_secret_key' => '', 50 'flickr_private_token' => '', 51 'flickr_content_type' => 'sets', 52 'flickr_sets_amount' => '9999', 53 'flickr_max_selected' => '0', 54 'flickr_show_limit' => '500', 55 'flickr_thumb_size' => 'square', 56 'flickr_large_size' => 'large_1024', 57 'flickr_cache_enabled' => '1', 58 'flickr_admin_cache_duration' => '30', 59 'flickr_cache_duration' => '168', 59 60 ); 60 61 … … 186 187 187 188 acf_render_field_setting( $field, array( 188 'label' => __(' Cache duration','acf-flickr'),189 'instructions' => __('The time your cache may last in minutes.','acf-flickr'),189 'label' => __('Front-end cache duration','acf-flickr'), 190 'instructions' => __('The time your front-end cache may last in minutes (how visitors view the photos).','acf-flickr'), 190 191 'type' => 'text', 191 192 'name' => 'flickr_cache_duration', 192 193 'class' => 'flickr_cache_duration', 194 'append' => 'minutes', 195 )); 196 197 acf_render_field_setting( $field, array( 198 'label' => __('Admin cache duration','acf-flickr'), 199 'instructions' => __('The time your admin cache may last in minutes. This is usually lower than the front-end cache duration.','acf-flickr'), 200 'type' => 'text', 201 'name' => 'flickr_admin_cache_duration', 202 'class' => 'flickr_admin_cache_duration', 193 203 'append' => 'minutes', 194 204 )); … … 282 292 } 283 293 if (is_writeable($cache_dir) && $field['flickr_cache_enabled'] == 1) { 284 $duration = $field['flickr_cache_duration'] * 60 * 60; 294 $admin_cache = isset($field['flickr_admin_cache_duration']) ? $field['flickr_admin_cache_duration'] : $field['flickr_cache_duration']; 295 $duration = $admin_cache * 60 * 60; 285 296 $f->enableCache('fs', $cache_dir, $duration); 286 297 } -
flickr-field-for-advanced-custom-fields/trunk/acf-flickr.php
r1325811 r1327415 4 4 Plugin URI: https://github.com/phuisman88/flickrfield 5 5 Description: Flickr field for Advanced Custom Fields. Display items from your photostream or entire sets/galleries along with your WordPress content. 6 Version: 1.1. 16 Version: 1.1.2 7 7 Author: Paul Huisman 8 8 Author URI: www.paulhuisman.com -
flickr-field-for-advanced-custom-fields/trunk/css/options.css
r1306180 r1327415 8 8 display: none; 9 9 } 10 [data-name="flickr_admin_cache_duration"] { 11 display: none; 12 } 10 13 .acf-field .description a { 11 14 text-decoration: underline; -
flickr-field-for-advanced-custom-fields/trunk/js/options.js
r1306180 r1327415 15 15 if ($(this).is(':checked') && $(this).val() == '1') { 16 16 $wrap.parent().parent().parent().find('[data-name="flickr_cache_duration"]').css('display', 'table-row'); 17 $wrap.parent().parent().parent().find('[data-name="flickr_admin_cache_duration"]').css('display', 'table-row'); 17 18 } 18 19 }); … … 28 29 // Toggle hidden cache field(s) 29 30 $(this).parent().parent().parent().find('[data-name="flickr_cache_duration"]').toggle(); 31 $(this).parent().parent().parent().find('[data-name="flickr_admin_cache_duration"]').toggle(); 30 32 }); 31 33 -
flickr-field-for-advanced-custom-fields/trunk/readme.txt
r1325811 r1327415 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.4.1 6 Stable tag: 1.1. 16 Stable tag: 1.1.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 58 58 == Changelog == 59 59 60 = 1.1.2 = 61 * Added seperate caching for the admin loading of flickr data. You now have a setting for front-end caching and admin (back-end) caching. 62 60 63 = 1.1.1 = 61 64 * You can now (optionally) use constants for flickr api key, secret and api token (for private mode). This could be useful in a multisite environment.
Note: See TracChangeset
for help on using the changeset viewer.