HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/lipovac/wp-content/plugins/the-events-calendar/common/src/Tribe/Utils/Post_Collection.php
<?php
/**
 * An extension of the base collection implementation to handle posts.
 *
 * @since 4.9.5
 */

/**
 * Class Tribe__Utils__Post_Collection
 *
 * @since 4.9.5
 */
class Tribe__Utils__Post_Collection extends Tribe__Utils__Collection {

	/**
	 * Tribe__Utils__Post_Collection constructor.
	 *
	 * Overrides the base constructor to ensure all elements in the collection are, in fact, posts.
	 * Elements that do not resolve to a post are discarded.
	 *
	 * @param array $items
	 */
	public function __construct( array $items ) {
		parent::__construct( array_filter( array_map( 'get_post', $items ) ) );
	}

	/**
	 * Plucks a meta key for all elements in the collection.
	 *
	 * Elements that are not posts or do not have the meta set will have an
	 * empty string value.
	 *
	 * @since 4.9.5
	 *
	 * @param string $meta_key The meta key to pluck.
	 * @param bool   $single   Whether to fetch the meta key as single or not.
	 *
	 * @return array An array of meta values for each item in the collection; items that
	 *               do not have the meta set or that are not posts, will have an empty
	 *               string value.
	 */
	public function pluck_meta( $meta_key, $single = true ) {
		$plucked = array();

		foreach ( $this as $item ) {
			$plucked[] = get_post_meta( $item->ID, $meta_key, $single );
		}

		return $plucked;
	}
}