Skip to content

Commit

Permalink
Avoid warnings on import old wpcalendar events (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig authored Nov 11, 2024
1 parent 40774be commit f7fec3e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions functions/activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function sunflower_import_events() {
$post->ID = 0;
$post->post_type = 'sunflower_event';

if ( $meta['_secretevent'][0] ) {
if ( isset( $meta['_secretevent'][0] ) && true === $meta['_secretevent'][0] ) {
$post->post_status = 'draft';
}

Expand All @@ -68,18 +68,18 @@ function sunflower_import_events() {

update_post_meta( $sunflower_original_post_id, '_sunflower_copied', true );

update_post_meta( $id, '_sunflower_event_location_city', $meta['_geostadt'][0] );
update_post_meta( $id, '_sunflower_event_location_name', $meta['_geoshow'][0] );
update_post_meta( $id, '_sunflower_event_lat', $meta['_lat'][0] );
update_post_meta( $id, '_sunflower_event_lon', $meta['_lon'][0] );
update_post_meta( $id, '_sunflower_event_zoom', $meta['_zoom'][0] );
update_post_meta( $id, '_sunflower_event_organizer', $meta['_veranstalter'][0] );
update_post_meta( $id, '_sunflower_event_organizer_url', $meta['_veranstalterlnk'][0] );
update_post_meta( $id, '_sunflower_event_location_city', $meta['_geostadt'][0] ?? '' );
update_post_meta( $id, '_sunflower_event_location_name', $meta['_geoshow'][0] ?? '' );
update_post_meta( $id, '_sunflower_event_lat', $meta['_lat'][0] ?? '' );
update_post_meta( $id, '_sunflower_event_lon', $meta['_lon'][0] ?? '' );
update_post_meta( $id, '_sunflower_event_zoom', $meta['_zoom'][0] ?? '' );
update_post_meta( $id, '_sunflower_event_organizer', $meta['_veranstalter'][0] ?? '' );
update_post_meta( $id, '_sunflower_event_organizer_url', $meta['_veranstalterlnk'][0] ?? '' );

update_post_meta( $id, '_sunflower_event_from', sunflower_german_date2int_date( $meta['_wpcal_from'][0] ) );
update_post_meta( $id, '_sunflower_event_until', sunflower_german_date2int_date( $meta['_bis'][0] ) );
update_post_meta( $id, '_sunflower_event_from', sunflower_german_date2int_date( $meta['_wpcal_from'][0] ?? '' ) );
update_post_meta( $id, '_sunflower_event_until', sunflower_german_date2int_date( $meta['_bis'][0] ?? '' ) );

if ( $meta['_thumbnail_id'][0] ) {
if ( isset( $meta['_thumbnail_id'][0] ) ) {
update_post_meta( $id, '_thumbnail_id', $meta['_thumbnail_id'][0] );
}
}
Expand Down

0 comments on commit f7fec3e

Please sign in to comment.