HEX
Server: Apache
System: Linux dinesh8149 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: usesambura1 (1212012)
PHP: 7.0.33
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: /home/storage/c/63/6c/usesambura1/public_html/yr/wp-content/themes/blocksy/inc/meta-boxes.php
<?php
/**
 * Implement meta boxes
 *
 * @copyright 2019-present Creative Themes
 * @license   http://www.gnu.org/copyleft/gpl.html GNU General Public License
 * @package   Blocksy
 */

if (! function_exists('blocksy_get_post_options')) {
	function blocksy_get_post_options($post_id = null, $args = []) {
		$args = wp_parse_args(
			$args,
			[
				'meta_id' => 'blocksy_post_meta_options'
			]
		);

		static $post_opts = [];

		if (! $post_id) {
			global $post;

			if ($post && is_singular()) {
				$post_id = $post->ID;
			}

			$maybe_page = blocksy_is_page();

			if ($maybe_page) {
				$post_id = $maybe_page;
			}
		}

		$cache_key = $post_id . ':' . $args['meta_id'];

		if (isset($post_opts[$cache_key])) {
			return $post_opts[$cache_key];
		}

		$values = get_post_meta($post_id, $args['meta_id']);

		if (empty($values)) {
			$values = [[]];
		}

		$post_opts[$cache_key] = $values[0];

		if (! is_array($values[0]) || ! $values[0]) {
			return [];
		}

		return $values[0];
	}
}

if (! function_exists('blocksy_get_taxonomy_options')) {
	function blocksy_get_taxonomy_options($term_id = null) {
		static $taxonomy_opts = [];

		if (! $term_id) {
			$term_id = get_queried_object_id();
		}

		if (isset($taxonomy_opts[$term_id])) {
			return $taxonomy_opts[$term_id];
		}

		$values = get_term_meta(
			$term_id,
			'blocksy_taxonomy_meta_options'
		);

		if ( empty( $values ) ) {
			$values = [ [] ];
		}

		$taxonomy_opts[$term_id] = $values[0];

		return $values[0];
	}
}