HEX
Server: LiteSpeed
System: Linux ragasnapis.serveriai.lt 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User: amdygua1 (1144)
PHP: 8.3.19
Disabled: link, symlink, exec, passthru, proc_close, proc_get_status, proc_open, shell_exec, system, popen, pclose, dl, show_source, highlight_file, pcntl_exec, ini_restore, ini_alter, chgrp
Upload Files
File: /home/amdygua1/domains/amicalingua1.lt/private_html/wp-content/themes/blocksy/inc/helpers/cpt.php
<?php

function blocksy_get_taxonomies_for_cpt($post_type, $args = []) {
	$args = wp_parse_args($args, [
		'return_empty' => false
	]);

	if ($post_type === 'product') {
		return [
			'product_cat' => __('Category', 'blocksy'),
			'product_tag' => __('Tag', 'blocksy')
		];
	}

	$result = [];

	$taxonomies = array_values(array_diff(
		get_object_taxonomies($post_type),
		['post_format']
	));

	if (count($taxonomies) === 0) {
		if ($args['return_empty']) {
			return [];
		}

		return [
			'default' => __('Default', 'blocksy')
		];
	}

	foreach ($taxonomies as $single_taxonomy) {
		$taxonomy_object = get_taxonomy($single_taxonomy);
		$result[$single_taxonomy] = $taxonomy_object->label;
	}

	return $result;
}