Hi @andrii
I created a date attribute in ‘requests’ called ‘event_date’
I’d like the requests to expire on that date that the user submits.
Is this possible please?
I found this code, but wasn’t sure if it was suitable if I modify it for the requests instead?
How to expire a listing with the date attribute given by the user
add_action(
'hivepress/v1/models/listing/update',
function( $listing_id, $listing ) {
if ( $listing->get_custom_expired_time() ) {
update_post_meta($listing_id, 'hp_expired_time', strtotime($listing->get_custom_expired_time()));
}
},
10,
2
);
Many thanks