Changeset 3106337
- Timestamp:
- 06/23/2024 10:21:49 PM (3 weeks ago)
- Location:
- my-calendar
- Files:
-
- 1354 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
my-calendar/trunk/includes/conditionals.php
r3081574 r3106337 195 195 196 196 /** 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 197 233 * Check whether a given output field should be displayed. 198 234 * -
my-calendar/trunk/includes/post-types.php
r3081574 r3106337 456 456 return $post_id; 457 457 } 458 459 460 461 458 462 // Copy post content to event. 459 463 $event_id = get_post_meta( $post_id, '_mc_event_id', true ); -
my-calendar/trunk/my-calendar-event-editor.php
r3096977 r3106337 212 212 update_post_meta( $post_id, '_mc_event_date', strtotime( $event_date ) ); 213 213 } 214 $location_id = ( isset( $post['location_preset'] ) && is_numeric( $post['location_preset'] ) ) ? (int) $post['location_preset'] : false;214 $location_id = ( isset( $post['location_preset'] ) && is_numeric( $post['location_preset'] ) ) ? (int) $post['location_preset'] : false; 215 215 if ( $location_id ) { // only change location ID if dropdown set. 216 216 update_post_meta( $post_id, '_mc_event_location', $location_id ); … … 272 272 $excerpt = isset( $data['event_short'] ) ? $data['event_short'] : ''; 273 273 $location_id = isset( $data['event_location'] ) ? $data['event_location'] : 0; 274 if ( isset( $post['location_preset'] ) && is_numeric( $post['location_preset'] ) ) {274 if ( isset( $post['location_preset'] ) && is_numeric( $post['location_preset'] ) ) { 275 275 $location_id = (int) $post['location_preset']; 276 276 } elseif ( isset( $data['location_preset'] ) && is_numeric( $data['location_preset'] ) ) { … … 2989 2989 */ 2990 2990 function mc_standard_event_registration( $form, $has_data, $data, $context = 'admin' ) { 2991 2992 2993 2991 2994 if ( $has_data ) { 2992 2995 $tickets = $data->event_tickets; -
my-calendar/trunk/my-calendar-output.php
r3086721 r3106337 1011 1011 foreach ( array_keys( $events ) as $key ) { 1012 1012 $event =& $events[ $key ]; 1013 if ( '00:00:00' === $event->event_endtime && mc_date( 'Y-m-d', strtotime( $event->occur_end ), false ) === $date && mc_date( 'Y-m-d', strtotime( $event->occur_begin ), false ) !== $date) {1013 if ( ) { 1014 1014 continue; 1015 1015 } … … 1468 1468 1469 1469 /** 1470 * Check whether an event should be hidden (privacy)1471 *1472 * @param object $event Event object.1473 *1474 * @return boolean1475 */1476 function mc_event_is_hidden( $event ) {1477 if ( ! is_object( $event ) ) {1478 return false;1479 }1480 // Also hide events that are unpublished if the current user does not have permission to edit.1481 if ( ! mc_event_published( $event ) && ! mc_can_edit_event( $event->event_id ) ) {1482 return true;1483 }1484 $category = $event->event_category;1485 $private = mc_get_private_categories();1486 /**1487 * Filter whether an event is visible to the current user.1488 *1489 * @hook mc_user_can_see_private_events1490 *1491 * @param {bool} $can_see 'true' if the event should be shown.1492 * @param {object} $event Event object.1493 *1494 * @return {bool}1495 */1496 $can_see = apply_filters( 'mc_user_can_see_private_events', is_user_logged_in(), $event );1497 if ( in_array( $category, $private, true ) && ! $can_see ) {1498 1499 return true;1500 }1501 1502 return false;1503 }1504 1505 /**1506 1470 * Translates the arguments passed to the calendar and process them to generate the actual view. 1507 1471 * … … 1511 1475 */ 1512 1476 function mc_calendar_params( $args ) { 1477 1478 1479 1480 1481 1513 1482 $format = isset( $args['format'] ) ? $args['format'] : 'calendar'; 1514 1483 $category = isset( $args['category'] ) ? $args['category'] : ''; … … 1538 1507 } 1539 1508 1540 $category = ( isset( $ _GET['mcat'] ) ) ? (int) $_GET['mcat'] : $category;1509 $category = ( isset( $['mcat'] : $category; 1541 1510 // This relates to default value inconsistencies, I think. 1542 1511 if ( '' === $category ) { … … 1544 1513 } 1545 1514 1546 if ( isset( $ _GET['format'] ) && in_array( $_GET['format'], $enabled, true ) && 'mini' !== $format ) {1547 $format = esc_attr( $ _GET['format'] );1515 if ( isset( $['format'], $enabled, true ) && 'mini' !== $format ) { 1516 $format = esc_attr( $['format'] ); 1548 1517 } else { 1549 1518 $format = esc_attr( $format ); … … 1551 1520 1552 1521 // Mini calendar prevents format switch to avoid having a widget calendar switch in addition to the main calendar. 1553 if ( isset( $ _GET['time'] ) && in_array( $_GET['time'], array( 'day', 'week', 'month', 'month+1' ), true ) && ! ( 'mini' === $format && ! in_the_loop() ) ) {1554 $time = esc_attr( $ _GET['time'] );1522 if ( isset( $['time'], array( 'day', 'week', 'month', 'month+1' ), true ) && ! ( 'mini' === $format && ! in_the_loop() ) ) { 1523 $time = esc_attr( $['time'] ); 1555 1524 } else { 1556 1525 $time = esc_attr( $time ); … … 1561 1530 } 1562 1531 1563 if ( isset( $ _GET['mcs'] ) ) {1564 $search = sanitize_text_field( $ _GET['mcs'] );1532 if ( isset( $['mcs'] ) ) { 1533 $search = sanitize_text_field( $['mcs'] ); 1565 1534 } 1566 1535 … … 2349 2318 } 2350 2319 2351 add_filter( 'mc_display_format', 'mc_convert_format', 10, 2 ); 2352 /** 2353 * Switch format for display depeding on environment. 2320 /** 2321 * Switch format for display depending on view environment. Used to display mini or list calendars on mobile devices. 2354 2322 * 2355 2323 * @param string $format current view. … … 2366 2334 return $format; 2367 2335 } 2336 2368 2337 2369 2338 /** -
my-calendar/trunk/my-calendar-shortcodes.php
r3096977 r3106337 23 23 */ 24 24 function my_calendar_insert( $atts, $content = null ) { 25 $args = shortcode_atts(25 $args = shortcode_atts( 26 26 array( 27 27 'name' => 'all', … … 52 52 'my_calendar' 53 53 ); 54 $args = map_deep( $args, 'sanitize_text_field' ); 54 $args = map_deep( $args, 'sanitize_text_field' ); 55 $args['content'] = $content; 55 56 56 57 if ( (int) get_the_ID() === (int) mc_get_option( 'uri_id' ) ) { -
my-calendar/trunk/my-calendar.php
r3096977 r3106337 18 18 * License URI: http://www.gnu.org/license/gpl-2.0.txt 19 19 * Domain Path: lang 20 * Version: 3.5. 720 * Version: 3.5. 21 21 */ 22 22 … … 55 55 return get_option( 'mc_version', '' ); 56 56 } 57 return '3.5. 7';57 return '3.5.'; 58 58 } 59 59 -
my-calendar/trunk/readme.txt
r3096977 r3106337 7 7 Requires PHP: 7.4 8 8 Text domain: my-calendar 9 Stable tag: 3.5. 79 Stable tag: 3.5. 10 10 License: GPLv2 or later 11 11 … … 95 95 96 96 == Changelog == 97 98 99 100 101 102 103 104 105 97 106 98 107 = 3.5.7 =
Note: See TracChangeset
for help on using the changeset viewer.