HEX
Server: Apache
System: Linux server11 5.10.0-33-amd64 #1 SMP Debian 5.10.226-1 (2024-10-03) x86_64
User: web95 (5097)
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/clients/client1/web95/web/wp-content/plugins/wpai-acf-add-on/helpers/functions.php
<?php

if ( ! function_exists('pmai_get_join_attr') ) {
	/**
	 * @param bool $attributes
	 * @return string
	 */
	function pmai_get_join_attr($attributes = false ) {
		// validate
		if( empty($attributes) ) {
			return '';
		}
		// vars
		$e = array();
		// loop through and render
		foreach( $attributes as $k => $v ) {
			$e[] = $k . '="' . esc_attr( $v ) . '"';
		}
		// echo
		return implode(' ', $e);
	}
}

if ( ! function_exists('pmai_join_attr') ) {
	/**
	 * @param bool $attributes
	 */
	function pmai_join_attr($attributes = false ){
		echo pmai_get_join_attr( $attributes );
	}
}

if ( ! function_exists('pmai_get_acf_group_by_slug') ) {

	function pmai_get_acf_group_by_slug( $slug ) {

		$local_groups = acf_get_local_field_groups();
		if ( ! empty( $local_groups[ $slug ] ) ) {
			$group     = new stdClass();
			$group->ID = $slug;
			return $group;
		}

		if (!empty($local_groups)) {
			foreach ($local_groups as $local_group) {
				if (isset($local_group['id']) && $local_group['id'] == $slug) {
					$group     = new stdClass();
					$group->ID = $slug;
					return $group;
				}
			}
		}

		global $wpdb;

		$group = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->posts} WHERE {$wpdb->posts}.post_type = %s AND {$wpdb->posts}.post_excerpt = %s", 'acf-field-group', $slug ));

		if ( ! empty($group) ) {
			return $group;
		}

		return false;
	}
}