Support

Account

Home Forums ACF PRO Add ACF Post Object Field to Existing Array Output

Unread

Add ACF Post Object Field to Existing Array Output

  • Within The Events Calendar Pro plugin, the following function is used to create the events loop on an individuals’ respective bio page:

    function tribe_organizer_upcoming_events( $post_id = false ) {
    
    		$post_id = Tribe__Events__Main::postIdHelper( $post_id );
    
    		if ( $post_id ) {
    
    			$args = array(
    				'organizer'      => $post_id,
    				'eventDisplay'   => 'list',
    				'posts_per_page' => apply_filters( 'tribe_events_single_organizer_posts_per_page', 100 ),
    			);
    
    			$html = tribe_include_view_list( $args );
    
    			return apply_filters( 'tribe_organizer_upcoming_events', $html );
    		}
    	}

    How can I add an ACF post object field (already linked relationally to the same custom post type as those found in the native events loop function) to this events loop?

    Currently, although the post object is “linked” relationally to an existing custom post type—and being output correctly on the front end of the events page itself—selecting it on the backend via ACF’s functionality does not trigger it to be added to the Events loop found on the individual’s bio page.

    Here is the exported PHP of the field:

    array(
    	'key' => 'group_5a26fec4071a0',
    	'title' => 'The Organizers',
    	'fields' => array(
    		array(
    			'key' => 'field_5a26ff1a9337b',
    			'label' => 'Organizers',
    			'name' => 'the_organizers',
    			'type' => 'post_object',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array(
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'post_type' => array(
    				0 => 'tribe_organizer',
    			),
    			'taxonomy' => array(
    			),
    			'allow_null' => 1,
    			'multiple' => 1,
    			'return_format' => 'object',
    			'ui' => 1
    		)
Viewing 1 post (of 1 total)

The topic ‘Add ACF Post Object Field to Existing Array Output’ is closed to new replies.