HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux elpuerto-web 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64
User: www-data (33)
PHP: 7.2.24-0ubuntu0.18.04.1
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,
Upload Files
File: /var/www/elpuerto/html/wp-content/plugins/menu-icons/includes/library/functions.php
<?php

/**
 * Misc. helper functions
 *
 * @author Dzikri Aziz <[email protected]>
 */


if ( ! function_exists( 'kucrut_get_array_value_deep' ) ) {
	/**
	 * Get value of a multidimensional array
	 *
	 * @since  0.1.0
	 * @param  array $array Haystack
	 * @param  array $keys  Needles
	 * @return mixed
	 */
	function kucrut_get_array_value_deep( array $array, array $keys ) {
		if ( empty( $array ) || empty( $keys ) ) {
			return $array;
		}

		foreach ( $keys as $idx => $key ) {
			unset( $keys[ $idx ] );

			if ( ! isset( $array[ $key ] ) ) {
				return null;
			}

			if ( ! empty( $keys ) ) {
				$array = $array[ $key ];
			}
		}

		if ( ! isset( $array[ $key ] ) ) {
			return null;
		}

		return $array[ $key ];
	}
}


if ( ! function_exists( 'kucrut_validate' ) ) {
	/**
	 * Validate settings values
	 *
	 * @param  array $values Settings values
	 * @return array
	 */
	function kucrut_validate( $values, $sanitize_cb = 'wp_kses_data' ) {
		foreach ( $values as $key => $value ) {
			if ( is_array( $value ) ) {
				$values[ $key ] = kucrut_validate( $value );
			} else {
				$values[ $key ] = call_user_func_array(
					$sanitize_cb,
					array( $value )
				);
			}
		}

		return $values;
	}
}


if ( ! function_exists( 'kucrut_get_image_sizes' ) ) {
	/**
	 * Get image sizes
	 *
	 * @since  0.9.0
	 * @access protected
	 * @return array
	 */
	function kucrut_get_image_sizes() {
		$_sizes = array(
			'thumbnail' => __( 'Thumbnail', 'menu-icons' ),
			'medium'    => __( 'Medium', 'menu-icons' ),
			'large'     => __( 'Large', 'menu-icons' ),
			'full'      => __( 'Full Size', 'menu-icons' ),
		);

		$_sizes = apply_filters( 'image_size_names_choose', $_sizes );

		$sizes = array();
		foreach ( $_sizes as $value => $label ) {
			$sizes[] = array(
				'value' => $value,
				'label' => $label,
			);
		}

		return $sizes;
	}
}


if ( ! function_exists( 'kucrut_get_script_suffix' ) ) {
	/**
	 * Get script & style suffix
	 *
	 * When SCRIPT_DEBUG is defined true, this will return '.min'.
	 *
	 * @return string
	 */
	function kucrut_get_script_suffix() {
		return ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
	}
}