PluginProbe
Timed Content / 2.94
Timed Content v2.94
2.99 trunk 1.0 1.1 1.2 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.10 2.11 2.12 2.15 2.2 2.3 2.3.1 2.4 2.5 2.5.1 2.50 2.51 2.52 All 67 releases
← All changes | lib/class-timedcontentplugin.php +8 -8 trunk2.94 View file →
@@ -581,9 +581,9 @@
581 581 $active_periods = array();
582 582 $period_count = 0;
583 583
584 584 $human_readable = (bool) $args['human_readable'];
585 - $freq = (int) $args['freq'];
585 + $freq = $args['freq'];
586 586 $timezone = $args['timezone'];
587 587 $recurr_type = $args['recurr_type'];
588 588 $num_repeat = intval( $args['num_repeat'] );
589 589 $end_date = $args['end_date'];
@@ -668,9 +668,9 @@
668 668
669 669 if ( ! $exception_period && $current > $right_now_t - $day_limit * 86400 ) {
670 670 // Adjust current date offset if start DST differs from current DST and we don't have a monthly pattern
671 671 $current_adjusted = $current;
672 - if (TIMED_CONTENT_FREQ_MONTHLY !== $freq) {
672 + if (!$monthly_pattern) {
673 673 $current_has_dst = $this->format_timestamp('I', $current);
674 674 if ('1' === $start_has_dst && '0' === $current_has_dst) {
675 675 $current_adjusted += 3600;
676 676 }
@@ -900,9 +900,9 @@
900 900 $action = __( 'Show the content', 'timed-content' );
901 901 } else {
902 902 $action = __( 'Hide the content', 'timed-content' );
903 903 }
904 - $freq = (int)$args['freq'];
904 + $freq = $args['freq'];
905 905 $timezone = $args['timezone'];
906 906 $recurr_type = $args['recurr_type'];
907 907 $num_repeat = intval( $args['num_repeat'] );
908 908 $end_date = $args['end_date'];
@@ -930,9 +930,9 @@
930 930 $instance_end_date,
931 931 $instance_end_time
932 932 );
933 933
934 - if ( TIMED_CONTENT_FREQ_HOURLY === $freq ) {
934 + if ( 0 === $freq ) {
935 935 $desc .= '<br />' . sprintf(
936 936 /* translators: %d numerical hours value */
937 937 _n(
938 938 'Repeat this action every %d hour.',
@@ -941,9 +941,9 @@
941 941 'timed-content'
942 942 ),
943 943 $interval_multiplier
944 944 );
945 - } elseif ( TIMED_CONTENT_FREQ_DAILY === $freq ) {
945 + } elseif ( 1 === $freq ) {
946 946 $desc .= '<br />' . sprintf(
947 947 /* translators: %d numerical days value */
948 948 _n(
949 949 'Repeat this action every %d day.',
@@ -952,9 +952,9 @@
952 952 'timed-content'
953 953 ),
954 954 $interval_multiplier
955 955 );
956 - } elseif ( TIMED_CONTENT_FREQ_WEEKLY === $freq ) {
956 + } elseif ( 2 === $freq ) {
957 957 if ( ( $days_of_week ) && ( is_array( $days_of_week ) ) ) {
958 958 $days = array();
959 959 $days_list = '';
960 960 foreach ( $days_of_week as $v ) {
@@ -1081,9 +1081,9 @@
1081 1081 ),
1082 1082 $interval_multiplier
1083 1083 );
1084 1084 }
1085 - } elseif ( TIMED_CONTENT_FREQ_MONTHLY === $freq ) {
1085 + } elseif ( 3 === $freq ) {
1086 1086 if ( 'yes' === $monthly_pattern ) {
1087 1087 if ( 1 === $interval_multiplier ) {
1088 1088 $desc .= '<br />' . sprintf(
1089 1089 /* translators: %1$s: recurrence, %2$s: weekday */
@@ -1119,9 +1119,9 @@
1119 1119 ),
1120 1120 $interval_multiplier
1121 1121 );
1122 1122 }
1123 - } elseif ( TIMED_CONTENT_FREQ_YEARLY === $freq ) {
1123 + } elseif ( 4 === $freq ) {
1124 1124 $desc .= '<br />' . sprintf(
1125 1125 /* translators: %d: year count */
1126 1126 _n(
1127 1127 'Repeat this action every %d year.',