Changeset 5849
- Timestamp:
- 08/31/2017 12:26:46 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-meeting-posttype/wporg-meeting-posttype.php
r5848 r5849 65 65 array( 66 66 'key'=>'recurring', 67 'value'=>array( 'weekly','monthly', '1'),67 'value'=>array( 'weekly', 'biweekly', 'monthly', '1' ), 68 68 'compare'=>'NOT IN', 69 69 ), … … 80 80 array( 81 81 'key'=>'recurring', 82 'value'=>array( 'weekly', 'monthly', '1'),82 'value'=>array( 'weekly', 'biweekly', 'monthly', '1' ), 83 83 'compare'=>'IN', 84 84 ), … … 128 128 } 129 129 $post->next_date = $next->format( 'Y-m-d' ); 130 } catch (Exception $e) { 131 // if the datetime is invalid, then set the post->next_date to the start date instead 132 $post->next_date = $post->start_date; 133 } 134 } else if ( $post->recurring == 'biweekly' ) { 135 try { 136 // advance the start date 2 weeks at a time until it's past now 137 $start = new DateTime( $post->start_date.' '.$post->time.' GMT' ); 138 $next = $start; 139 $now = new DateTime(); 140 while ( $now > $next ) { 141 $next->modify('+2 weeks'); 142 } 143 $post->next_date = $next->format('Y-m-d'); 130 144 } catch (Exception $e) { 131 145 // if the datetime is invalid, then set the post->next_date to the start date instead … … 259 273 </label> 260 274 <label for="recurring"><?php _e( 'Recurring: ', 'wporg' ); ?> 275 <input type="radio" name="recurring" value="weekly" id="weekly" class="regular-radio" <?php checked( $recurring, 'weekly' ); ?>> 261 276 <label for="weekly"><?php _e( 'Weekly', 'wporg' ); ?></label> 262 <input type="radio" name="recurring" value="weekly" class="regular-radio" <?php checked( $recurring, 'weekly' ); ?>> 277 <input type="radio" name="recurring" value="biweekly" id="biweekly" class="regular-radio" <?php checked( $recurring, 'biweekly' ); ?>> 278 <label for="biweekly"><?php _e( 'Biweekly', 'wporg' ); ?></label> 279 <input type="radio" name="recurring" value="monthly" id="monthly" class="regular-radio" <?php checked( $recurring, 'monthly' ); ?>> 263 280 <label for="monthly"><?php _e( 'Monthly', 'wporg' ); ?></label> 264 <input type="radio" name="recurring" value="monthly" class="regular-radio" <?php checked( $recurring, 'monthly' ); ?>>265 281 </label> 266 282 </p> … … 332 348 $meta['end_date'] = ( isset( $_POST['end_date'] ) ? esc_textarea( $_POST['end_date'] ) : '' ); 333 349 $meta['time'] = ( isset( $_POST['time'] ) ? esc_textarea( $_POST['time'] ) : '' ); 334 $meta['recurring'] = ( isset ( $_POST['recurring'] ) && ( in_array( $_POST['recurring'], array( 'weekly', 'monthly') ) ) ? ( $_POST['recurring'] ) : '' );350 $meta['recurring'] = ( isset ( $_POST['recurring'] ) && ( in_array( $_POST['recurring'], array( 'weekly', 'biweekly', 'monthly' ) ) ) ? ( $_POST['recurring'] ) : '' ); 335 351 $meta['link'] = ( isset( $_POST['link'] ) ? esc_url( $_POST['link'] ) : '' ); 336 352 $meta['location'] = ( isset( $_POST['location'] ) ? esc_textarea( $_POST['location'] ) : '' );
Note: See TracChangeset
for help on using the changeset viewer.