| Server IP : 38.190.208.107 / Your IP : 216.73.217.46 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.2/wp-content/themes/blocksy/inc/helpers/ |
Upload File : |
<?php
function blocksy_isolated_get_search_form($args) {
if (class_exists('IS_Admin_Public')) {
remove_filter(
'get_search_form',
[\IS_Admin_Public::getInstance(), 'get_search_form'],
9999999
);
}
get_search_form($args);
if (class_exists('IS_Admin_Public')) {
add_filter(
'get_search_form',
[\IS_Admin_Public::getInstance(), 'get_search_form'],
9999999
);
}
}
function blocksy_reqursive_taxonomy($tax, $parent_term_id, $level, $selected_cat) {
if (! $parent_term_id) {
return [];
}
$terms = get_terms([
'taxonomy' => $tax,
'hide_empty' => true,
'hierarchical' => false,
'parent' => $parent_term_id,
]);
if (!count($terms)) {
return [];
}
$els = [];
foreach ($terms as $term) {
$selected_attr = $selected_cat == $term->term_id ? 'selected' : '';
$prefix = ' ';
for ($i=0; $i < $level; $i++) {
$prefix .= ' ';
}
$els[] = blocksy_html_tag(
'option',
[
'value' => $tax . ':' . $term->term_id,
$selected_attr => $selected_attr
],
$prefix . $term->name
);
$children = get_terms([
'taxonomy' => $tax,
'hide_empty' => true,
'hierarchical' => false,
'parent' => $term->term_id,
]);
if (count($children)) {
$els = array_merge(
$els,
blocksy_reqursive_taxonomy(
$tax,
$term->term_id,
$level + 1,
$selected_cat
)
);
}
}
return $els;
}
function blocksy_get_search_post_type($search_through = []) {
$all_cpts = blocksy_manager()->post_types->get_supported_post_types();
if (function_exists('is_bbpress')) {
$all_cpts[] = 'forum';
$all_cpts[] = 'topic';
$all_cpts[] = 'reply';
}
if (class_exists('Tribe__Events__Main')) {
$all_cpts[] = 'tribe_events';
}
foreach ($all_cpts as $single_cpt) {
if (! isset($search_through[$single_cpt])) {
$search_through[$single_cpt] = false;
}
}
$post_type = [];
foreach ($search_through as $single_post_type => $enabled) {
if (
! $enabled
||
! get_post_type_object($single_post_type)
) {
continue;
}
if (
$single_post_type !== 'post'
&&
$single_post_type !== 'page'
&&
$single_post_type !== 'product'
&&
! in_array($single_post_type, $all_cpts)
) {
continue;
}
$post_type[] = $single_post_type;
}
// All subtypes used in the REST API Post Search Handler.
// wp-includes/rest-api/search/class-wp-rest-post-search-handler.php
$rest_api_all_subtypes = array_diff(
array_values(
get_post_types(
[
'public' => true,
'show_in_rest' => true
],
'names'
)
),
['attachment']
);
if (
count(array_keys($search_through)) === count($post_type)
&&
count($post_type) === count($rest_api_all_subtypes)
) {
$post_type = [];
}
return $post_type;
}