Created
April 10, 2017 02:23
-
-
Save RiFi2k/ef9eb08df23a3fcc60cc28d6134a233b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php update_post_meta( $post_id, $meta_key, $meta_value, $prev_value ); ?> | |
//add attendee to event ateendee list (relationship) | |
$event_id = $_POST['post_id']; | |
$attendee_list = get_field( 'attendees_list', $event_id ); | |
$new_attendee = get_post( $attendee_id ); | |
if( !is_array($attendee_list) ): | |
$attendee_list = array(); | |
endif; | |
array_push( $attendee_list, $new_attendee ); | |
update_field( 'field_54811a48219fd', $attendee_list, $event_id ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment