HEX
Server: Apache
System: Linux jomarlogistica 6.14.0-29-generic #29~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Aug 14 16:52:50 UTC 2 x86_64
User: jomarlogistica.com.br (1021295)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhosts/jomarlogistica.com.br/httpdocs/wp-content/plugins/case-theme-user/inc/templates.php
<?php
if (! defined('ABSPATH')) {
    exit(); // Exit if accessed directly
}

/**
 * Get template file.
 * 
 * Check template file from theme and plugin load_template() file.
 * @package User Press
 * @version 1.0.0
 */
if (! function_exists('up_get_template_part')) {

    function up_get_template_part($slug, $name = '')
    {
        $template = '';
        
        // Look in yourtheme/woorestaurant/slug-name.php
        if ($slug && $name && file_exists(userpress()->theme_dir . "{$slug}-{$name}.php")) {
            $template = userpress()->theme_dir . "{$slug}-{$name}.php";
        }
        
        // If template file doesn't exist, look in yourtheme/woorestaurant/slug.php
        if (! $template && file_exists(userpress()->theme_dir . "{$slug}.php")) {
            $template = userpress()->theme_dir . "{$slug}.php";
        }
        
        // Get default slug-name.php
        if (! $template && $name && file_exists(userpress()->templates_dir . "{$slug}-{$name}.php")) {
            $template = userpress()->templates_dir . "{$slug}-{$name}.php";
        }
        
        // If default file doesn't exist, look in slug.php
        if (! $template && file_exists(userpress()->templates_dir . "{$slug}.php")) {
            $template = userpress()->templates_dir . "{$slug}.php";
        }
        
        if ($template) {
            
            // Allow 3rd party plugin filter template file from their plugin
            $template = apply_filters('wr_get_template_part', $template, $slug, $name);
            
            // load template file.
            load_template($template, false);
        }
    }
}

if(!function_exists('up_get_template_css')){
    /**
     * get template uri.
     * 
     * @param unknown $layout
     * @return string|boolean
     */
    function up_get_template_css($layout) {
        
        $css_uri = $css_dir = '';
        
        if(!$layout)
            return ;
        
        if(is_dir(userpress()->theme_dir . $layout)){
            
            $css_uri = userpress()->theme_url . $layout .'/users-press-' . $layout . '.css';
            $css_dir = userpress()->theme_dir . $layout .'/users-press-' . $layout . '.css';
        } elseif (is_dir(userpress()->templates_dir . $layout)){
            
            $css_uri = userpress()->templates_url . $layout .'/users-press-' . $layout . '.css';
            $css_dir = userpress()->templates_dir . $layout .'/users-press-' . $layout . '.css';
        }
        
        if(!$css_uri && !file_exists($css_dir))
            return;
        
        wp_enqueue_style('users-press-' . $layout, $css_uri);
    }
}

/**
 * Get list layouts.
 * 
 * Check templates from plugin and theme get layouts name.
 * @return layout name.
 * @package User Press
 * @version 1.0.0
 */
if(!function_exists('up_get_template_list')){
	
	function up_get_template_list(){
		
		$in_plugin = false;
		$in_theme = false;
		
		if(file_exists(userpress()->templates_dir))
		$in_plugin = scandir(userpress()->templates_dir);
		
		if(file_exists(userpress()->theme_dir))
		$in_theme = scandir(userpress()->theme_dir);
		
		/* if layout in theme + plugin. */
		if($in_plugin && $in_theme){
		    
		    unset($in_plugin[0]);
		    unset($in_plugin[1]);
		    unset($in_theme[0]);
		    unset($in_theme[1]);
					    
			$in_plugin = array_unique(array_merge($in_plugin , $in_theme));
			
			return $in_plugin;
		}
		
		/* if layout in plugin. */
		if($in_plugin){
			
			unset($in_plugin[0]);
			unset($in_plugin[1]);
			
			return $in_plugin;
		}
		
	}	
}