| Server IP : 89.108.64.180 / Your IP : 216.73.217.92 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,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, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/testsite1441.ru/wp-content/themes/hotello/inc/ |
Upload File : |
<?php
/**
* Get rows and cells
*
* @return array
*/
function hotello_header_parts()
{
return array(
'rows' => array('top', 'center', 'bottom'),
'cells' => array('left', 'center', 'right')
);
}
/**
* Locate template in builder
*
* @param string|array $templates Single or array of template files
*
* @return string
*/
function hotello_locate_builder_element($templates, $template_name = '')
{
$located = false;
foreach ((array)$templates as $template) {
$folder = $template;
if (!empty($template_name)) {
$template = $template_name;
}
if (substr($template, -4) !== '.php') {
$template .= '.php';
}
if (!($located = locate_template('resources/partials/header/elements/' . $folder . '/' . $template))) {
$located = get_template_directory() . 'resources/partials/header/elements/' . $folder . '/' . $template;
}
if (file_exists($located)) {
break;
}
}
return apply_filters('stm_listings_locate_template', $located, $templates);
}
/**
* Load template
*
* @param $__template
* @param array $__vars
*/
function hotello_load_element($__template, $__vars = array(), $__template_name = '')
{
extract($__vars);
include hotello_locate_builder_element($__template, $__template_name);
}
function hotello_get_wpml_langs()
{
if (defined('ICL_LANGUAGE_CODE')) {
$current_language_code = ICL_LANGUAGE_CODE;
$langs = icl_get_languages('skip_missing=0');
$wpml = array();
if (!empty($langs)) {
if (!empty($langs[$current_language_code])) {
$current_language = $langs[$current_language_code];
$wpml[] = array(
'label' => $current_language['native_name'],
'url' => $current_language['url'],
);
}
foreach ($langs as $lang_key => $lang_info) {
if ($lang_key !== $current_language_code) {
$wpml[] = array(
'label' => $lang_info['native_name'],
'url' => $lang_info['url'],
);
}
}
}
}
if (empty($langs)) {
$wpml = [
array(
'label' => esc_html__('English', 'hotello'),
'url' => '/'
),
];
}
return apply_filters('hotel_get_wpml_langs', $wpml);
}
function hotello_get_dropdown($dropdown)
{
$choices = array(
'first' => [],
'others' => []
);
if (!empty($dropdown[0]) and !empty($dropdown[0]['label'])) {
$choices['first'] = $dropdown[0];
}
array_shift($dropdown);
if (!empty($dropdown)) {
$choices['others'] = $dropdown;
}
return $choices;
}
function hotello_get_filter($filter)
{
if (!empty($filter)) {
$choices['others'] = $filter;
}
return $choices;
}
function hotello_element_style($element)
{
$style_class = '';
if (!empty($element['data']) and !empty($element['data']['style'])) {
$style_class = $element['data']['style'];
}
return " stm-header__element_{$style_class}";
}
?>