| Server IP : 141.193.213.10 / Your IP : 216.73.216.190 Web Server : nginx System : Linux pod-400555 6.8.0-1055-gke #61-Ubuntu SMP Tue May 26 22:57:42 UTC 2026 x86_64 User : fpm200079 ( 200079) PHP Version : 8.2.35 Disable Function : apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,disk_free_space,disk_total_space,diskfreespace,dl,exec,fastcgi_finish_request,link,opcache_compile_file,opcache_get_configuration,opcache_invalidate,opcache_is_script_cached,opcache_reset,passthru,pclose,pcntl_exec,popen,posix_getpid,posix_getppid,posix_getpwuid,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,realpath_cache_get,shell_exec,show_source,symlink,system MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nas/content/live/bartislaw/wp-content/themes/spk/lib/ |
Upload File : |
<?php
/**
* Common functions
*
* @package Leads Builder
* @author TigerWP
* @link http://www.leadzbuilder.com/
*
*/
/* ---------------------------------------------------------------------------
* Attachment | GET attachment data
* --------------------------------------------------------------------------- */
if (!function_exists('lb_get_attachment_data')) {
function lb_get_attachment_data($image, $data, $with_key = false) {
$size = $return = false;
if (!is_numeric($image)) {
// QUICK FIX https
$image_ID = lb_get_attachment_id_url($image);
print_r($image_ID);
if (!$image_ID) {
$image = str_replace('https://', 'http://', $image);
$image_ID = lb_get_attachment_id_url($image);
}
$image = $image_ID;
}
$meta = wp_prepare_attachment_for_js($image);
if (is_array($meta) && isset($meta[$data])) {
$return = $meta[$data];
// if looking for alt and it isn't specified use image title
if ($data == 'alt' && !$return) {
$return = $meta['title'];
}
}
if ($return && $with_key) {
$return = $data . '="' . $return . '"';
}
return $return;
}
}
/* ---------------------------------------------------------------------------
* Attachment | GET attachment ID by URL
* --------------------------------------------------------------------------- */
if (!function_exists('lb_get_attachment_id_url')) {
function lb_get_attachment_id_url($image_url) {
global $wpdb;
$image_url = esc_url($image_url);
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url));
if (isset($attachment[0])) {
return $attachment[0];
}
}
}
if (!function_exists('lb_get_categories')) {
/**
* GET Categories | Categories for posts or specified taxonomy
*
* @param string $category Category slug
* @return array
*/
function lb_get_categories($category) {
$categories = get_categories(array('taxonomy' => $category));
// if ('testimonials_types' == $category) {
// echo '<pre>';
// print_r($categories);
// exit;
// }
$array = array('' => __('All', 'lb-opts'));
foreach ($categories as $cat) {
if (is_object($cat))
$array[$cat->slug] = $cat->name;
}
return $array;
}
}
/* ---------------------------------------------------------------------------
* Custom Image Sizes
* --------------------------------------------------------------------------- */
if (!function_exists('custom_image_size')) {
function custom_image_size() {
add_image_size('50x50', 50, 50, false);
add_image_size('150x150', 150, 150, false);
add_image_size('team-gen', 400, 400, false);
add_image_size('team-two', 274, 374, TRUE);
// common sizes for blog
add_image_size('500x500', 500, 500, false);
add_image_size('600x400', 600, 400, TRUE);
add_image_size('400x600', 400, 600, false);
add_image_size('full-size', 1000, 400, false);
}
}
add_action('after_setup_theme', 'custom_image_size', 11);
function lb_excerpt_length($length) {
return 30;
}
add_filter('excerpt_length', 'lb_excerpt_length');
function lb_excerpt_more($more) {
return '';
}
add_filter('excerpt_more', 'lb_excerpt_more');