HEX
Server: Apache
System: Linux web2213.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: clinicamaciel (596848)
PHP: 7.3.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,eval,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/clinicamaciel/www/index_lixo/wp-content/themes/virtue/lib/sidebar.php
<?php
/**
 * Determines whether or not to display the sidebar based on an array of conditional tags or page templates.
 *
 * If any of the is_* conditional tags or is_page_template(template_file) checks return true, the sidebar will NOT be displayed.
 *
 * @param array list of conditional tags (http://codex.wordpress.org/Conditional_Tags)
 * @param array list of page templates. These will be checked via is_page_template()
 *
 * @return boolean True will display the sidebar, False will not
 *
 */
class Kadence_Sidebar {
  private $conditionals;
  private $templates;

  public $display = true;

  function __construct($conditionals = array(), $templates = array()) {
    $this->conditionals = $conditionals;
    $this->templates    = $templates;

    $conditionals = array_map(array($this, 'check_conditional_tag'), $this->conditionals);
    $templates    = array_map(array($this, 'check_page_template'), $this->templates);

    if (in_array(true, $conditionals) || in_array(true, $templates)) {
      $this->display = false;
    }
  }

  private function check_conditional_tag($conditional_tag) {
    if (is_array($conditional_tag)) {
      return call_user_func_array($conditional_tag[0], $conditional_tag[1]);
    } else {
      return $conditional_tag();
    }
  }

  private function check_page_template($page_template) {
    return is_page_template($page_template);
  }
}
function kadence_sidebar_id() {
    if(is_front_page()) {
      global $virtue;
        if (!empty($virtue['home_sidebar'])) {
          $sidebar = $virtue['home_sidebar'];
          }
        else  {
          $sidebar = 'sidebar-primary';
        } 
    } else if( class_exists('woocommerce') and (is_shop() || is_product_category() || is_product_tag())) {
        global $virtue;
        if (!empty($virtue['shop_sidebar'])) {
          $sidebar = $virtue['shop_sidebar'];
        } else {
          $sidebar = 'sidebar-primary';
        } 
    } elseif( class_exists('woocommerce') and (is_account_page())) {
            get_template_part('templates/account', 'sidebar');
            $sidebar = "";
    } elseif(is_page_template('page-blog.php') || is_page_template('page-sidebar.php') || is_page_template('page-feature-sidebar.php') || (get_post_type() == 'post')) {
      global $post;
      $sidebar_name = get_post_meta( $post->ID, '_kad_sidebar_choice', true ); 
        if (!empty($sidebar_name)) {
            $sidebar = $sidebar_name;
        } else  {
            $sidebar = 'sidebar-primary';
        } 
    } else if (is_archive()) {
      $sidebar = 'sidebar-primary';
    } else if(is_category()) {
      $sidebar = 'sidebar-primary';
    } elseif (is_tag()) {
      $sidebar = 'sidebar-primary';
    } elseif (is_post_type_archive()) {
      $sidebar = 'sidebar-primary';
    } elseif (is_day()) {
       $sidebar = 'sidebar-primary';
    } elseif (is_month()) {
       $sidebar = 'sidebar-primary';
    } elseif (is_year()) {
       $sidebar = 'sidebar-primary';
    } elseif (is_author()) {
       $sidebar = 'sidebar-primary';
    } elseif (is_search()) {
      $sidebar = 'sidebar-primary';
    } else {
      $sidebar = 'sidebar-primary';
    }

    return apply_filters('kadence_sidebar_id', $sidebar);
}