Conversation
| // If the group doesn't exist, mark it as canceled. Note: This is different from removed-from-chapter. | ||
| if ( false === $group_details ) { | ||
| // Only mark active groups as removed. | ||
| if ( ! in_array( get_post( $post_id )->post_status, [ 'wcpt-mtp-active', 'wcpt-mtp-dormant', 'wcpt-mtp-nds-nw-ow' ] ) ) { | ||
| return; | ||
| } | ||
|
|
||
| add_post_meta( | ||
| $post_id, | ||
| '_note', | ||
| array( | ||
| 'timestamp' => time(), | ||
| 'user_id' => 0, | ||
| 'message' => 'Meetup no longer exists per Meetup.com API sync.', | ||
| ) | ||
| ); | ||
|
|
||
| $self_loop_prevent = true; | ||
|
|
||
| wp_update_post( array( | ||
| 'ID' => $post_id, | ||
| 'post_status' => 'wcpt-mtp-canceled', | ||
| ) ); | ||
|
|
||
| $self_loop_prevent = false; | ||
|
|
||
| return; | ||
| } |
There was a problem hiding this comment.
I'm not actually sure I want to automatically remove groups from the post_status, but given the number of meetups who were listed as being active but no longer existed for whatever reason..
| update_post_meta( $post_id, 'Meetup Coordinates', "{$group_details['lat']},{$group_details['lon']}" ); | ||
| update_post_meta( $post_id, '_lat', $group_details['lat'] ); | ||
| update_post_meta( $post_id, '_lon', $group_details['lon'] ); |
There was a problem hiding this comment.
I was adding this such that I could source the location of all WP Meetups via this listing.
I'm not sure that this is viable however, as there isn't a strict 1:1 mapping of groups to entries here, as the entries are more applications-for-meetups tracking, and there can be multiple entries for a singular active meetup.
|
I personally suggest that this remove be made manually or set a trigger to be able to do it properly. This will help on accidental deletions and further errors that could arise from the same |
This updates the Meetup listings to:
Include the Member count on the overviewProperly exclude the WordPress organizer from the listingsSplit some items into #1573