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/functions/query.php
<?php
/**
 * A set of functions to manipulate queries or query properties.
 *
 * @since 4.9.5
 */

if ( ! function_exists( 'tribe_filter_meta_query' ) ) {
	/**
	 * Removes meta query entries based on key and value.
	 *
	 * Example usage to remove all date-related meta queries, using a regular expression:
	 *
	 * $query->meta_query = tribe_filter_meta_query(
	 *      $args['meta_query'],
	 *      array( 'key' => '/_Event(Start|End)Date(UTC)/' )
	 * );
	 *
	 * @since 4.9.5
	 *
	 * @param array $meta_query The meta query array to filter, usually the content of the `$query->meta_query`
	 *                          property.
	 * @param array $where      A map of criteria for the filtering that will be applied with OR logic: if an
	 *                          entry matches even one then it will be removed. If the value of the comparison is a
	 *                          regular expression, with fences, then it will be used for a `preg_match` check against
	 *                          the key, not a simple comparison.
	 *
	 * @return array The filtered meta query array.
	 */
	function tribe_filter_meta_query( array $meta_query, array $where ) {
		$filtered = array();

		foreach ( $meta_query as $key => $entry ) {
			if ( ! is_array( $entry ) ) {
				$filtered[ $key ] = $entry;
				continue;
			}

			foreach ( $where as $where_key => $where_value ) {
				if ( isset( $entry[ $where_key ] ) ) {
					if ( tribe_is_regex( $where_value ) ) {
						$var = $entry[ $where_key ];
						if ( preg_match( $where_value, $var ) ) {
							continue 2;
						}
					} elseif ( $entry[ $where_key ] == $where_value ) {
						continue 2;
					}
				}
			}
			$filtered[ $key ] = $entry;
		}

		return $filtered;
	}
}