Changeset 1703182
- Timestamp:
- 07/26/2017 02:39:36 PM (9 years ago)
- Location:
- post-rotation/trunk
- Files:
-
- 4 edited
-
admin/post-rotation-admin.php (modified) (2 diffs)
-
post-rotation-core.php (modified) (5 diffs)
-
post-rotation.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-rotation/trunk/admin/post-rotation-admin.php
r1608779 r1703182 25 25 settings_fields( 'pr-settings-group' ); 26 26 27 if ( get_option( 'pr_enabled' ) === '1') {27 if ( get_option( 'pr_enabled' ) ) { 28 28 global $selected_post; 29 29 global $discrepancy; … … 69 69 <tr> 70 70 <td> 71 <p>Interval<span class="extended"><?php if ( get_option( 'pr_fixed' ) !== '1') { echo ' without new posts'; } ?></span>:</p>71 <p>Interval<span class="extended"><?php if ( ! get_option( 'pr_fixed' ) ) { echo ' without new posts'; } ?></span>:</p> 72 72 <input type="number" min="0" max="999" id="pr-interval-hours" name="pr_interval[hours]" value="<?php echo esc_attr( get_option( 'pr_interval' )['hours'] ); ?>" /> 73 73 <label>hours.</label> -
post-rotation/trunk/post-rotation-core.php
r1608779 r1703182 2 2 defined( 'ABSPATH' ) || die( 'Cannot access pages directly.' ); 3 3 4 $pr_included_categories = array_map( function( $cat_id ) {4 get_option( 'pr_included_categories' ) ? $pr_included_categories = array_map( function( $cat_id ) { 5 5 return + $cat_id; 6 }, get_option( 'pr_included_categories' ) ) ;6 }, get_option( 'pr_included_categories' ) ) : $pr_included_categories = array(); 7 7 8 8 function selected_post() { … … 29 29 } 30 30 31 if ( get_option( 'pr_enabled' ) === '1' && is_array( $pr_included_categories )) {31 if ( get_option( 'pr_enabled' ) && $pr_included_categories ) { 32 32 global $wpdb; 33 33 … … 56 56 $this_moment = strtotime( current_time( 'mysql' ) ); 57 57 58 if ( get_option( 'pr_fixed' ) === '1' && '' !==$latest_rotation_time ) {58 if ( get_option( 'pr_fixed' ) && $latest_rotation_time ) { 59 59 $key_moment = $latest_rotation_time; 60 60 } else { … … 65 65 66 66 if ( $discrepancy >= $pr_interval && $selected_post ) { 67 if ( get_option( 'pr_enforce_punctuality' ) === '1') {67 if ( get_option( 'pr_enforce_punctuality' ) ) { 68 68 $new_date_unix = $key_moment + $pr_interval; 69 69 $new_date = date( 'Y-m-d H:i:s', $new_date_unix ); … … 80 80 $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_date = %s, post_date_gmt = %s WHERE ID = %d", $new_date, $new_date_gmt, $selected_post ) ); 81 81 82 if ( get_option( 'pr_also_alter_last_modified' ) === '1') {82 if ( get_option( 'pr_also_alter_last_modified' ) ) { 83 83 $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_modified = %s, post_modified_gmt = %s WHERE ID = %d", $new_date, $new_date_gmt, $selected_post ) ); 84 84 } -
post-rotation/trunk/post-rotation.php
r1608779 r1703182 4 4 Plugin URI: http://www.digitalemphasis.com/wordpress-plugins/post-rotation/ 5 5 Description: Set the rotation interval or the allowed time without new posts... and automatically the oldest post becomes the latest one! 6 Version: 1. 56 Version: 1.6 7 7 Author: digitalemphasis 8 8 Author URI: http://www.digitalemphasis.com/ … … 107 107 108 108 function pr_uninstall() { 109 if ( get_option( 'pr_clean_uninstall' ) === '1') {109 if ( get_option( 'pr_clean_uninstall' ) ) { 110 110 delete_option( 'pr_latest_rotation_time' ); 111 111 delete_option( 'pr_enabled' ); -
post-rotation/trunk/readme.txt
r1608779 r1703182 4 4 Donate link: http://www.digitalemphasis.com/donate/ 5 5 Tags: admin, administration, automatic, post, posts, post rotation, post rotator, rotation, rotator, interval, frequency 6 Requires at least: 3.57 Tested up to: 4. 78 Stable tag: 1. 56 Requires at least: 4.0 7 Tested up to: 4.8 8 Stable tag: 1.6 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 58 58 == Changelog == 59 59 60 = 1.6 = 61 * Ensure compatibility with WordPress 4.8 62 * Fixed: no more 'array_map(): Argument #2 should be an array...' warnings when no category is selected. 63 * Code optimization. 64 60 65 = 1.5 = 61 66 * Ensure compatibility with WordPress 4.6 and 4.7
Note: See TracChangeset
for help on using the changeset viewer.