| 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/omapart.ru/wp-content/plugins/hoteller-elementor/ |
Upload File : |
<?php
if(!function_exists('hoteller_is_registered'))
{
function hoteller_is_registered() {
$hoteller_is_registered = get_option("envato_purchase_code_".ENVATOITEMID);
if(!empty($hoteller_is_registered)) {
return $hoteller_is_registered;
}
else {
return false;
}
}
}
if(!function_exists('hoteller_get_lazy_img_attr'))
{
function hoteller_get_lazy_img_attr()
{
$tg_enable_lazy_loading = get_theme_mod('tg_enable_lazy_loading');
$return_attr = array('class' => '','source' => 'src');
if(!empty($tg_enable_lazy_loading))
{
$return_attr = array('class' => 'lazy','source' => 'data-src');
}
return $return_attr;
}
}
if(!function_exists('hoteller_get_blank_img_attr'))
{
function hoteller_get_blank_img_attr()
{
$tg_enable_lazy_loading = get_theme_mod('tg_enable_lazy_loading');
$return_attr = '';
if(!empty($tg_enable_lazy_loading))
{
$return_attr = 'src=""';
}
return $return_attr;
}
}
if(!function_exists('hoteller_get_post_format_icon'))
{
function hoteller_get_post_format_icon($post_id = '')
{
$return_html = '';
if(!empty($post_id))
{
$post_format = get_post_format($post_id);
if($post_format == 'video')
{
$return_html = '<div class="post_type_icon"><i class="fa fa-play"></i></div>';
}
}
return $return_html;
}
}
if(!function_exists('hoteller_limit_get_excerpt'))
{
function hoteller_limit_get_excerpt($excerpt = '', $limit = 50, $string = '...')
{
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, $limit);
$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
$excerpt = $excerpt.'...';
return '<p>'.$excerpt.'</p>';
}
}
if(!function_exists('hoteller_get_image_id'))
{
function hoteller_get_image_id($url)
{
$attachment_id = attachment_url_to_postid($url);
if(!empty($attachment_id))
{
return $attachment_id;
}
else
{
return $url;
}
}
}
if(!function_exists('hoteller_substr'))
{
function hoteller_substr($str, $length, $minword = 3)
{
$sub = '';
$len = 0;
foreach (explode(' ', $str) as $word)
{
$part = (($sub != '') ? ' ' : '') . $word;
$sub .= $part;
$len += strlen($part);
if (strlen($word) > $minword && strlen($sub) >= $length)
{
break;
}
}
return $sub . (($len < strlen($str)) ? '...' : '');
}
}
/**
* Add custom link URL for image use in theme landing site
*/
function themegoods_attachment_field_credit ($form_fields, $post) {
$form_fields['themegoods-link-url'] = array(
'label' => 'Custom Link URL',
'input' => 'text',
'value' => esc_url(get_post_meta( $post->ID, 'themegoods_link_url', true )),
);
return $form_fields;
}
add_filter( 'attachment_fields_to_edit', 'themegoods_attachment_field_credit', 10, 2 );
/**
* Save values of Photographer Name and URL in media uploader
*/
function themegoods_attachment_field_credit_save ($post, $attachment) {
if( isset( $attachment['themegoods-link-url'] ) )
update_post_meta( $post['ID'], 'themegoods_link_url', esc_url( $attachment['themegoods-link-url'] ) );
return $post;
}
add_filter( 'attachment_fields_to_save', 'themegoods_attachment_field_credit_save', 10, 2 );
?>