init.php
public function get_all_objects( $args, $attached = array() ) {
		$objects = $this->get_objects( $args );

		$attached_objects = array();
		foreach ( $objects as $object ) {
			$attached_objects[ $this->get_id( $object ) ] = $object;
		}

		if ( ! empty( $attached ) ) {
			$is_users = $this->field->options( 'query_users' );
			$args[ $is_users ? 'include' : 'post__in' ] = $attached;
			$args[ $is_users ? 'number' : 'posts_per_page' ] = count( $attached );

			$new = $this->get_objects( $args );

			foreach ( $new as $object ) {
				if ( ! isset( $attached_objects[ $this->get_id( $object ) ] ) ) {
					$attached_objects[ $this->get_id( $object ) ] = $object;
				}
			}
		}

		return $attached_objects;
	}
public function get_all_objects( $args, $attached = array() ) {
		$objects = $this->get_objects( $args );

		$attached_objects = array();
		foreach ( $objects as $object ) {
			$attached_objects[ $this->get_id( $object ) ] = $object;
		}

		if ( ! empty( $attached ) ) {
			$is_users = $this->field->options( 'query_users' );
			$args[ $is_users ? 'include' : 'post__in' ] = $attached;
			$args[ $is_users ? 'number' : 'posts_per_page' ] = count( $attached );

			$new = $this->get_objects( $args );

			foreach ( $new as $object ) {
				if ( ! isset( $attached_objects[ $this->get_id( $object ) ] ) ) {
					$attached_objects[ $this->get_id( $object ) ] = $object;
				}
			}
		}

		return $attached_objects;
	}
public function get_all_objects ( $ args , $ attached = array ( ) ) { $ objects = $ this -> get_objects ( $ args ) ; $ attached_objects = array ( ) ; foreach ( $ objects as $ object ) { $ attached_objects [ $ this -> get_id ( $ object ) ] = $ object ; } if ( ! empty ( $ attached ) ) { $ is_users = $ this -> field -> options ( 'query_users' ) ; $ args [ $ is_users ? 'include' : 'post__in' ] = $ attached ; $ args [ $ is_users ? 'number' : 'posts_per_page' ] = count ( $ attached ) ; $ new = $ this -> get_objects ( $ args ) ; foreach ( $ new as $ object ) { if ( ! isset ( $ attached_objects [ $ this -> get_id ( $ object ) ] ) ) { $ attached_objects [ $ this -> get_id ( $ object ) ] = $ object ; } } } return $ attached_objects ; }
Fetches the default query for items, and combines with any objects attached.

@since  1.2.4

@param  array  $args     Array of query args.
@param  array  $attached Array of attached object ids.

@return array            Array of attached object ids.
Fetches the default query for items and combines with any objects attached .