| Server IP : 176.32.38.42 / Your IP : 216.73.216.67 Web Server : LiteSpeed System : Linux ha006.mymail.zone 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64 User : s1225329 ( 1835) PHP Version : 7.4.33 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/s1225329/domains/azazalalka.ru/public_html/wp-content/themes/satori/ |
Upload File : |
<?php
/**
* satori functions and definitions
*
* @package Satori
*/
define( 'SATORI_THEME_VERSION' , '1.1.06' );
// Upgrade / Go Premium page
require get_template_directory() . '/upgrade/upgrade.php';
// Load WP included scripts
require get_template_directory() . '/includes/inc/template-tags.php';
require get_template_directory() . '/includes/inc/extras.php';
require get_template_directory() . '/includes/inc/jetpack.php';
require get_template_directory() . '/includes/inc/customizer.php';
// Load Customizer Library scripts
require get_template_directory() . '/customizer/customizer-options.php';
require get_template_directory() . '/customizer/customizer-library/customizer-library.php';
require get_template_directory() . '/customizer/styles.php';
require get_template_directory() . '/customizer/mods.php';
// Load TGM plugin class
require_once get_template_directory() . '/includes/inc/class-tgm-plugin-activation.php';
// Add customizer Upgrade class
require_once( trailingslashit( get_template_directory() ) . 'includes/satori-pro/class-customize.php' );
if ( ! function_exists( 'satori_setup' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function satori_setup() {
/**
* Set the content width based on the theme's design and stylesheet.
*/
global $content_width;
if ( ! isset( $content_width ) ) {
$content_width = 900; /* pixels */
}
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on satori, use a find and replace
* to change 'satori' to the name of your theme in all the template files
*/
load_theme_textdomain( 'satori', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'satori_blog_img_side', 500, 500, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary Menu', 'satori' ),
'footer-bar' => __( 'Footer Bar Menu', 'satori' )
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',
) );
// The custom logo is used for the logo
add_theme_support( 'custom-logo', array(
'height' => 145,
'width' => 280,
'flex-height' => false,
'flex-width' => false,
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'satori_custom_background_args', array(
'default-color' => 'FFFFFF'
) ) );
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
endif; // satori_setup
add_action( 'after_setup_theme', 'satori_setup' );
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
function satori_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'satori' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar(array(
'name' => __( 'Sidebar Menu', 'satori' ),
'id' => 'satori-sidebar-menu',
'description' => __( 'These widgets are placed in the slide out menu under the navigation.', 'satori' )
));
register_sidebar(array(
'name' => __( 'Satori Footer Centered', 'satori' ),
'id' => 'satori-site-footer-centered',
'description' => __( 'The footer will add widgets centered below each other.', 'satori' )
));
register_sidebar(array(
'name' => __( 'Satori Footer Standard', 'satori' ),
'id' => 'satori-site-footer-standard',
'description' => __( 'The footer will divide into however many widgets are placed here.', 'satori' )
));
}
add_action( 'widgets_init', 'satori_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function satori_scripts() {
wp_enqueue_style( 'satori-body-font-default', '//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic', array(), SATORI_THEME_VERSION );
wp_enqueue_style( 'satori-heading-font-default', '//fonts.googleapis.com/css?family=Kaushan+Script', array(), SATORI_THEME_VERSION );
wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/includes/font-awesome/css/all.min.css', array(), '5.9.0' );
wp_enqueue_style( 'satori-style', get_stylesheet_uri(), array(), SATORI_THEME_VERSION );
if ( get_theme_mod( 'satori-header-layout' ) == 'satori-header-layout-two' ) :
wp_enqueue_style( 'satori-header-style-two', get_template_directory_uri().'/templates/css/header-two.css', array(), SATORI_THEME_VERSION );
else :
wp_enqueue_style( 'satori-header-style-one', get_template_directory_uri().'/templates/css/header-one.css', array(), SATORI_THEME_VERSION );
endif;
wp_enqueue_style( 'satori-standard-woocommerce-style', get_template_directory_uri().'/templates/css/woocommerce-standard-style.css', array(), SATORI_THEME_VERSION );
wp_enqueue_style( 'satori-footer-social-style', get_template_directory_uri().'/templates/css/footer-social.css', array(), SATORI_THEME_VERSION );
wp_enqueue_script( 'caroufredsel', get_template_directory_uri() . '/js/jquery.carouFredSel-6.2.1-packed.js', array('jquery'), SATORI_THEME_VERSION, true );
wp_enqueue_script( 'satori-customjs', get_template_directory_uri() . '/js/custom.js', array('jquery'), SATORI_THEME_VERSION, true );
if ( get_theme_mod( 'satori-slider-size' ) == 'satori-slider-size-screen' ) :
wp_enqueue_script( 'satori-slider-screen-js', get_template_directory_uri() . '/js/screen-slider.js', array('jquery'), SATORI_THEME_VERSION, true );
endif;
wp_enqueue_script( 'satori-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), SATORI_THEME_VERSION, true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'satori_scripts' );
/**
* To maintain backwards compatibility with older versions of WordPress
*/
function satori_the_custom_logo() {
if ( function_exists( 'the_custom_logo' ) ) {
the_custom_logo();
}
}
/**
* Add theme stying to the theme content editor
*/
function satori_add_editor_styles() {
add_editor_style();
}
add_action( 'admin_init', 'satori_add_editor_styles' );
/**
* Enqueue admin styling.
*/
function satori_load_admin_script() {
wp_enqueue_style( 'satori-admin-css', get_template_directory_uri() . '/upgrade/css/admin-css.css' );
}
add_action( 'admin_enqueue_scripts', 'satori_load_admin_script' );
/**
* Enqueue satori custom customizer styling.
*/
function satori_load_customizer_script() {
wp_enqueue_script( 'satori-customizer-js', get_template_directory_uri() . '/customizer/customizer-library/js/customizer-custom.js', array('jquery'), SATORI_THEME_VERSION, true );
wp_enqueue_style( 'satori-customizer-css', get_template_directory_uri() . '/customizer/customizer-library/css/customizer.css' );
}
add_action( 'customize_controls_enqueue_scripts', 'satori_load_customizer_script' );
/**
* Check if WooCommerce exists.
*/
if ( ! function_exists( 'satori_is_woocommerce_activated' ) ) :
function satori_is_woocommerce_activated() {
if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
}
endif; // satori_is_woocommerce_activated
// If WooCommerce exists include ajax cart
if ( satori_is_woocommerce_activated() ) {
require get_template_directory() . '/includes/inc/woocommerce-header-inc.php';
}
/**
* Adjust is_home query if satori-blog-cats is set
*/
function satori_set_blog_queries( $query ) {
$blog_query_set = '';
if ( get_theme_mod( 'satori-blog-cats', false ) ) {
$blog_query_set = get_theme_mod( 'satori-blog-cats' );
}
if ( $blog_query_set ) {
// do not alter the query on wp-admin pages and only alter it if it's the main query
if ( !is_admin() && $query->is_main_query() ){
if ( is_home() ){
$query->set( 'cat', esc_attr( $blog_query_set ) );
}
}
}
}
add_action( 'pre_get_posts', 'satori_set_blog_queries' );
/**
* Display recommended plugins with the TGM class
*/
function satori_register_required_plugins() {
$plugins = array(
// The recommended WordPress.org plugins.
array(
'name' => __( 'Elementor Page Builder', 'satori' ),
'slug' => 'elementor',
'required' => false,
'external_url' => 'https://kairaweb.com/go/elementor/'
),
array(
'name' => __( 'Breadcrumb NavXT', 'satori' ),
'slug' => 'breadcrumb-navxt',
'required' => false,
),
array(
'name' => __( 'Meta Slider', 'satori' ),
'slug' => 'ml-slider',
'required' => false,
)
);
$config = array(
'id' => 'satori',
'menu' => 'tgmpa-install-plugins'
);
tgmpa( $plugins, $config );
}
add_action( 'tgmpa_register', 'satori_register_required_plugins' );
/**
* Register a custom Post Categories ID column
*/
function satori_edit_cat_columns( $satori_cat_columns ) {
$satori_cat_in = array( 'cat_id' => 'Category ID <span class="cat_id_note">For the Default Slider</span>' );
$satori_cat_columns = satori_cat_columns_array_push_after( $satori_cat_columns, $satori_cat_in, 0 );
return $satori_cat_columns;
}
add_filter( 'manage_edit-category_columns', 'satori_edit_cat_columns' );
/**
* Print the ID column
*/
function satori_cat_custom_columns( $value, $name, $cat_id ) {
if( 'cat_id' == $name )
echo $cat_id;
}
add_filter( 'manage_category_custom_column', 'satori_cat_custom_columns', 10, 3 );
/**
* Insert an element at the beggining of the array
*/
function satori_cat_columns_array_push_after( $src, $satori_cat_in, $pos ) {
if ( is_int( $pos ) ) {
$R = array_merge( array_slice( $src, 0, $pos + 1 ), $satori_cat_in, array_slice( $src, $pos + 1 ) );
} else {
foreach ( $src as $k => $v ) {
$R[$k] = $v;
if ( $k == $pos )
$R = array_merge( $R, $satori_cat_in );
}
}
return $R;
}
/**
* Dismissable Admin notice with Satori setup/general help
*/
function satori_add_license_notice() {
global $current_user;
$satori_user_id = $current_user->ID;
if ( !get_user_meta( $satori_user_id, 'satori_flash_notice_ignore' ) ) : ?>
<div class="notice notice-info satori-admin-notice satori-notice-add">
<h4>
<?php esc_html_e( 'Thank you for trying out Satori!', 'satori' ); ?> -
<span>
<?php
/* translators: %s: 'Recommended Resources' */
printf( esc_html__( 'Satori Premium is currently on a %1$s for only $12', 'satori' ), wp_kses( __( '<a href="https://kairaweb.com/wordpress-theme/satori/#purchase-premium" target="_blank">50% sale</a>', 'satori' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ) );
?>
</span>
</h4>
<p><?php esc_html_e( 'We\'re here to help... Please read through our help notes below on getting started with Satori:', 'satori' ); ?></p>
<div class="satori-admin-notice-blocks">
<div class="satori-admin-notice-block">
<h5><?php esc_html_e( 'About Satori:', 'satori' ); ?></h5>
<p>
<?php esc_html_e( 'Satori is a widely used and much loved WordPress theme which gives you lots of different customization settings... so you can easily change the look of your site any time.', 'satori' ); ?>
</p>
<p>
<?php
/* translators: %s: 'Recommended Resources' */
printf( esc_html__( 'Read through our %1$s and %2$s and we\'ll help you build a professional website easily.', 'satori' ), wp_kses( __( '<a href="https://kairaweb.com/support/wordpress-recommended-resources/" target="_blank">Recommended Resources</a>', 'satori' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), wp_kses( __( '<a href="https://kairaweb.com/documentation/" target="_blank">Kaira Documentation</a>', 'satori' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ) );
?>
</p>
<a href="<?php echo esc_url( admin_url( 'themes.php?page=about_satori' ) ) ?>" class="satori-admin-notice-btn">
<?php esc_html_e( 'Read More About Satori', 'satori' ); ?>
</a>
</div>
<div class="satori-admin-notice-block">
<h5><?php esc_html_e( 'Using Satori:', 'satori' ); ?></h5>
<p>
<?php
/* translators: %s: 'set up your site in WordPress' */
printf( esc_html__( 'See our recommended %1$s and how to get ready before you start building your website after you\'ve %2$s.', 'satori' ), wp_kses( __( '<a href="https://kairaweb.com/documentation/our-recommended-wordpress-basic-setup/" target="_blank">WordPress basic setup</a>', 'satori' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), wp_kses( __( '<a href="https://kairaweb.com/wordpress-hosting/" target="_blank">setup WordPress Hosting</a>', 'satori' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ) );
?>
</p>
<a href="<?php echo esc_url( 'https://kairaweb.com/support/wordpress-recommended-resources/' ) ?>" class="satori-admin-notice-btn-in" target="_blank">
<?php esc_html_e( 'Recommended Resources', 'satori' ); ?>
</a>
<p>
<?php esc_html_e( 'We\'ve neatly built most of the Satori settings into the WordPress Customizer so you can see all your changes happen as you built your site.', 'satori' ); ?>
</p>
<a href="<?php echo esc_url( admin_url( 'customize.php' ) ) ?>" class="satori-admin-notice-btn-grey">
<?php esc_html_e( 'Start Customizing Your Website', 'satori' ); ?>
</a>
</div>
<div class="satori-admin-notice-block satori-nomargin">
<h5><?php esc_html_e( 'Popular FAQ\'s:', 'satori' ); ?></h5>
<p>
<?php esc_html_e( 'See our list of popular help links for building your website and/or any issues you may have.', 'satori' ); ?>
</p>
<ul>
<li>
<a href="https://kairaweb.com/documentation/setting-up-the-default-slider/" target="_blank"><?php esc_html_e( 'Setup the Satori default slider', 'satori' ); ?></a>
</li>
<li>
<a href="https://kairaweb.com/documentation/adding-custom-css-to-wordpress/" target="_blank"><?php esc_html_e( 'Adding Custom CSS to WordPress', 'satori' ); ?></a>
</li>
<li>
<a href="https://kairaweb.com/documentation/mobile-menu-not-working/" target="_blank"><?php esc_html_e( 'Mobile Menu is not working', 'satori' ); ?></a>
</li>
<li>
<a href="https://kairaweb.com/wordpress-theme/satori/#premium-features" target="_blank"><?php esc_html_e( 'What does Satori Premium offer', 'satori' ); ?></a>
</li>
</ul>
<a href="<?php echo esc_url( 'https://kairaweb.com/documentation/' ) ?>" class="satori-admin-notice-btn-grey" target="_blank">
<?php esc_html_e( 'See More Documentation', 'satori' ); ?>
</a>
</div>
</div>
<a href="?satori_add_license_notice_ignore=" class="satori-notice-close"><?php esc_html_e( 'Dismiss Notice', 'satori' ); ?></a>
</div><?php
endif;
}
add_action( 'admin_notices', 'satori_add_license_notice' );
/**
* Admin notice save dismiss to wp transient
*/
function satori_add_license_notice_ignore() {
global $current_user;
$satori_user_id = $current_user->ID;
if ( isset( $_GET['satori_add_license_notice_ignore'] ) ) {
update_user_meta( $satori_user_id, 'satori_flash_notice_ignore', true );
}
}
add_action( 'admin_init', 'satori_add_license_notice_ignore' );