File: /home/rearbear/public_html/wp-content/themes/houseware/functions.php
<?php
/**
* Houseware theme functions
*
* When using a child theme (see http://codex.wordpress.org/Theme_Development
* and http://codex.wordpress.org/Child_Themes), you can override certain
* functions (those wrapped in a function_exists() call) by defining them first
* in your child theme's functions.php file. The child theme's functions.php
* file is included before the parent theme's file, so the child theme
* functions would be used.
*
* Text Domain: houseware
* @link http://codex.wordpress.org/Plugin_API
*
*/
if(is_admin()) {
// Requires & Recommend plugins
if(! class_exists('TGM_Plugin_Activation')) {
require_once(get_stylesheet_directory() .'/includes/class-tgm-plugin-activation.php');
}
require_once(get_stylesheet_directory() .'/includes/tgm-plugin-activation.php');
if(! class_exists('ThemeUpdateChecker')) {
require_once(get_stylesheet_directory() .'/includes/theme-update-checker.php');
}
$theme_updater = new ThemeUpdateChecker('houseware', 'https://woovina.com/');
// Activate License Key
if(class_exists('WooVina_Theme_Licenses')) {
$license = new WooVina_Theme_Licenses('Child Theme', 'Houseware');
}
}
/**
* Load the parent style.css file
*
* @link http://codex.wordpress.org/Child_Themes
*/
function houseware_enqueue_parent_style() {
// Dynamically get version number of the parent stylesheet (lets browsers re-cache your stylesheet when you update your theme)
$theme = wp_get_theme('WooVina');
$version = $theme->get('Version');
// Load the stylesheet
wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('woovina-style'), $version);
}
add_action('wp_enqueue_scripts', 'houseware_enqueue_parent_style');
/**
* Load the child theme demo CSS file
*
*/
function houseware_enqueue_style() {
// Dynamically get version number of the parent stylesheet (lets browsers re-cache your stylesheet when you update your theme)
$theme = wp_get_theme('Houseware');
$version = $theme->get('Version');
// Set default CSS
if(!get_theme_mod('woovina_css_file')) {
set_theme_mod('woovina_css_file', 'houseware-01.css');
}
// Load the stylesheet
wp_enqueue_style('woovina-niche', get_stylesheet_directory_uri() . '/assets/css/' . get_theme_mod('woovina_css_file'), false, $version);
// Load the font fontello
wp_enqueue_style('fontello', get_stylesheet_directory_uri() . '/assets/css/fontello.css', false);
// Load custom JS
wp_enqueue_script('houseware-js', get_stylesheet_directory_uri() . '/assets/js/houseware.js', array('jquery'), $version, true);
}
add_action('wp_enqueue_scripts', 'houseware_enqueue_style');
/**
* Run copyright removal
*
* @since 1.5
*/
function houseware_copyright_removal() {
$theme = wp_get_theme();
$license = get_option('edd_license_details');
$license_details = (isset($license) && isset($license['woovina_houseware'])) ? $license['woovina_houseware'] : false;
if(! empty($license_details) && is_object($license_details) && true === $license_details->success && 'Houseware Free' != $license_details->item_name) {
return false;
}
echo '<div id="woovina-copyright" class="hide-tablet hide-mobile">Powered by <br><a href="https://woovina.com/child-themes/houseware" title="Free Responsive WooCommerce WordPress Theme" target="_blank">Houseware Theme</a></div>';
}
add_action('woovina_copyright_removal', 'houseware_copyright_removal');
/**
* Show activate notice
*
* @since 1.5
*/
function houseware_activate_notice() {
$license = get_option('edd_license_details');
$license_details = (isset($license) && isset($license['woovina_houseware'])) ? $license['woovina_houseware'] : false;
if(!class_exists('WooVina_Extra') || (! empty($license_details) && is_object($license_details) && true === $license_details->success)) {
return false;
}
?>
<div id="woovina-admin-notice" class="updated notice is-dismissible" style="padding-top: 10px;">
<strong><?php _e('Thanks for using Houseware Theme', 'houseware'); ?></strong>
<p><?php _e('Please activate your license to get feature updates, premium support and unlimited access to the pro demos!', 'houseware'); ?>
<br><?php echo sprintf(
__('If you don\'t have any license key, you can %1$sget a FREE license here%2$s.', 'houseware'),
'<a href="https://woovina.com/child-themes/houseware?ref=dashboard#child-purchase-now" target="_blank" title="Get your FREE license key!">',
'</a>'
); ?></p>
<p><a class="btn button-primary" href="admin.php?page=woovina-panel-licenses"><?php _e('Activate Now', 'houseware'); ?></a></p>
</div>
<?php
}
add_action('admin_notices', 'houseware_activate_notice');
/**
* Show upgrade notice
*
* @since 1.5
*/
function houseware_upgrade_notice() {
$license = get_option('edd_license_details');
$license_details = (isset($license) && isset($license['woovina_houseware'])) ? $license['woovina_houseware'] : false;
if(isset($license_details) && is_object($license_details) && true === $license_details->success && 'Houseware Free' == $license_details->item_name)
{
?>
<div id="woovina-admin-notice" class="updated notice is-dismissible" style="padding-top: 10px;">
<strong><?php _e('You are using the free license of Houseware Theme!', 'houseware'); ?></strong>
<p><?php _e('To receive automatic updates, to activate premium plugins you need to have a higher license.', 'houseware'); ?>
<br><?php _e('Upgrade your license today at a very discounted price <strong>$39</strong>!', 'houseware'); ?></p>
<p><a class="btn button-primary" href="https://woovina.com/my-account/upgrade-account?ref=dashboard" target="_blank"><?php _e('Upgrade License', 'houseware'); ?></a> <a class="btn button-secondary" href="https://woovina.com/child-themes/houseware?ref=dashboard#child-purchase-now" target="_blank"><?php _e('Plans & Pricing', 'houseware'); ?></a></p>
</div>
<?php
}
}
add_action('admin_notices', 'houseware_upgrade_notice');
/**
* Show renewal notice
*
* @since 1.5
*/
function houseware_renewal_notice() {
$license = get_option('edd_license_details');
$license_details = (isset($license) && isset($license['woovina_houseware'])) ? $license['woovina_houseware'] : false;
$now = current_time('timestamp');
$expire_date = isset($license_details->expires) && trim($license_details->expires) != '' ? $license_details->expires : '';
$expiration = strtotime($expire_date, current_time('timestamp'));
if(! empty($license_details) && is_object($license_details) && true === $license_details->success && $expiration < $now)
{
?>
<div id="woovina-admin-notice" class="updated notice is-dismissible" style="padding-top: 10px;">
<strong><?php _e('Your license has expired!', 'houseware'); ?></strong>
<p><?php _e('Whoops! It looks like your Houseware license has expired! That means that you will not receive automatic updates.', 'houseware'); ?>
<br><?php _e('You can renew your license by click on the below button!', 'houseware'); ?></p>
<p><a class="btn button-primary" href="https://woovina.com/my-account/renew-membership?ref=dashboard" target="_blank"><?php _e('Renew License Now', 'houseware'); ?></a></p>
</div>
<?php
}
}
add_action('admin_notices', 'houseware_renewal_notice');
/**
* Get Houseware demos.
*
* @since 1.5
*/
function houseware_get_demos() {
$theme_url = get_stylesheet_directory_uri() . '/demos/';
$theme_dir = get_stylesheet_directory() . '/demos/';
$data = array(
'Layout 1' => array(
'demo_class' => 'free-demo',
'xml_file' => $theme_dir . 'houseware-01/contents.xml',
'theme_settings' => $theme_url . 'houseware-01/customizer.json',
'widgets_file' => $theme_url . 'houseware-01/widgets.wie',
'preview_image' => $theme_url . 'houseware-01/houseware-01.jpg',
'form_file' => $theme_url . 'houseware-01/form.json',
'preview_url' => 'https://houseware.woovina.net/demo-01/',
'home_title' => 'Home',
'blog_title' => 'Blog',
'posts_to_show' => '12',
'elementor_width' => '1200',
'css_file' => 'houseware-01.css',
'woo_image_size' => '600',
'woo_thumb_size' => '250',
'woo_crop_width' => '5',
'woo_crop_height' => '4',
'required_plugins' => array(
'free' => array(
array(
'slug' => 'elementor',
'init' => 'elementor/elementor.php',
'name' => 'Elementor',
),
array(
'slug' => 'woocommerce',
'init' => 'woocommerce/woocommerce.php',
'name' => 'WooCommerce',
),
array(
'slug' => 'wpforms-lite',
'init' => 'wpforms-lite/wpforms.php',
'name' => 'WPForms',
),
),
'premium' => array(
array(
'slug' => 'woovina-sticky-header',
'init' => 'woovina-sticky-header/woovina-sticky-header.php',
'name' => 'WooVina Sticky Header',
),
array(
'slug' => 'woovina-preloader',
'init' => 'woovina-preloader/woovina-preloader.php',
'name' => 'WooVina Preloader',
),
array(
'slug' => 'woovina-product-sharing',
'init' => 'woovina-product-sharing/woovina-product-sharing.php',
'name' => 'WooVina Product Sharing',
),
array(
'slug' => 'woovina-popup-login',
'init' => 'woovina-popup-login/woovina-popup-login.php',
'name' => 'WooVina Popup Login',
),
array(
'slug' => 'woovina-woo-popup',
'init' => 'woovina-woo-popup/woovina-woo-popup.php',
'name' => 'WooVina Woo Popup',
),
),
),
),
'Layout 2' => array(
'demo_class' => 'free-demo',
'xml_file' => $theme_dir . 'houseware-02/contents.xml',
'theme_settings' => $theme_url . 'houseware-02/customizer.json',
'widgets_file' => $theme_url . 'houseware-02/widgets.wie',
'preview_image' => $theme_url . 'houseware-02/houseware-02.jpg',
'form_file' => $theme_url . 'houseware-02/form.json',
'preview_url' => 'https://houseware.woovina.net/demo-02/',
'home_title' => 'Home',
'blog_title' => 'Blog',
'posts_to_show' => '12',
'elementor_width' => '1200',
'css_file' => 'houseware-02.css',
'woo_image_size' => '600',
'woo_thumb_size' => '250',
'woo_crop_width' => '5',
'woo_crop_height' => '4',
'required_plugins' => array(
'free' => array(
array(
'slug' => 'elementor',
'init' => 'elementor/elementor.php',
'name' => 'Elementor',
),
array(
'slug' => 'woocommerce',
'init' => 'woocommerce/woocommerce.php',
'name' => 'WooCommerce',
),
array(
'slug' => 'wpforms-lite',
'init' => 'wpforms-lite/wpforms.php',
'name' => 'WPForms',
),
),
'premium' => array(
array(
'slug' => 'woovina-sticky-header',
'init' => 'woovina-sticky-header/woovina-sticky-header.php',
'name' => 'WooVina Sticky Header',
),
array(
'slug' => 'woovina-preloader',
'init' => 'woovina-preloader/woovina-preloader.php',
'name' => 'WooVina Preloader',
),
array(
'slug' => 'woovina-product-sharing',
'init' => 'woovina-product-sharing/woovina-product-sharing.php',
'name' => 'WooVina Product Sharing',
),
array(
'slug' => 'woovina-popup-login',
'init' => 'woovina-popup-login/woovina-popup-login.php',
'name' => 'WooVina Popup Login',
),
array(
'slug' => 'woovina-woo-popup',
'init' => 'woovina-woo-popup/woovina-woo-popup.php',
'name' => 'WooVina Woo Popup',
),
array(
'slug' => 'woovina-variation-swatches',
'init' => 'woovina-variation-swatches/woovina-variation-swatches.php',
'name' => 'WooVina Variation Swatches',
),
),
),
),
'Layout 3' => array(
'demo_class' => 'pro-demo',
'xml_file' => $theme_dir . 'houseware-03/contents.xml',
'theme_settings' => $theme_url . 'houseware-03/customizer.json',
'widgets_file' => $theme_url . 'houseware-03/widgets.wie',
'preview_image' => $theme_url . 'houseware-03/houseware-03.jpg',
'form_file' => $theme_url . 'houseware-03/form.json',
'preview_url' => 'https://houseware.woovina.net/demo-03/',
'home_title' => 'Home',
'blog_title' => 'Blog',
'posts_to_show' => '12',
'elementor_width' => '1200',
'css_file' => 'houseware-03.css',
'woo_image_size' => '600',
'woo_thumb_size' => '250',
'woo_crop_width' => '5',
'woo_crop_height' => '4',
'required_plugins' => array(
'free' => array(
array(
'slug' => 'elementor',
'init' => 'elementor/elementor.php',
'name' => 'Elementor',
),
array(
'slug' => 'woocommerce',
'init' => 'woocommerce/woocommerce.php',
'name' => 'WooCommerce',
),
array(
'slug' => 'wpforms-lite',
'init' => 'wpforms-lite/wpforms.php',
'name' => 'WPForms',
),
),
'premium' => array(
array(
'slug' => 'woovina-preloader',
'init' => 'woovina-preloader/woovina-preloader.php',
'name' => 'WooVina Preloader',
),
array(
'slug' => 'woovina-product-sharing',
'init' => 'woovina-product-sharing/woovina-product-sharing.php',
'name' => 'WooVina Product Sharing',
),
array(
'slug' => 'woovina-popup-login',
'init' => 'woovina-popup-login/woovina-popup-login.php',
'name' => 'WooVina Popup Login',
),
array(
'slug' => 'woovina-woo-popup',
'init' => 'woovina-woo-popup/woovina-woo-popup.php',
'name' => 'WooVina Woo Popup',
),
array(
'slug' => 'woovina-variation-swatches',
'init' => 'woovina-variation-swatches/woovina-variation-swatches.php',
'name' => 'WooVina Variation Swatches',
),
),
),
),
'Layout 4' => array(
'demo_class' => 'pro-demo',
'xml_file' => $theme_dir . 'houseware-04/contents.xml',
'theme_settings' => $theme_url . 'houseware-04/customizer.json',
'widgets_file' => $theme_url . 'houseware-04/widgets.wie',
'preview_image' => $theme_url . 'houseware-04/houseware-04.jpg',
'form_file' => $theme_url . 'houseware-04/form.json',
'preview_url' => 'https://houseware.woovina.net/demo-04/',
'home_title' => 'Home',
'blog_title' => 'Blog',
'posts_to_show' => '12',
'elementor_width' => '1200',
'css_file' => 'houseware-04.css',
'woo_image_size' => '600',
'woo_thumb_size' => '250',
'woo_crop_width' => '5',
'woo_crop_height' => '4',
'required_plugins' => array(
'free' => array(
array(
'slug' => 'elementor',
'init' => 'elementor/elementor.php',
'name' => 'Elementor',
),
array(
'slug' => 'woocommerce',
'init' => 'woocommerce/woocommerce.php',
'name' => 'WooCommerce',
),
array(
'slug' => 'wpforms-lite',
'init' => 'wpforms-lite/wpforms.php',
'name' => 'WPForms',
),
),
'premium' => array(
array(
'slug' => 'woovina-preloader',
'init' => 'woovina-preloader/woovina-preloader.php',
'name' => 'WooVina Preloader',
),
array(
'slug' => 'woovina-product-sharing',
'init' => 'woovina-product-sharing/woovina-product-sharing.php',
'name' => 'WooVina Product Sharing',
),
array(
'slug' => 'woovina-popup-login',
'init' => 'woovina-popup-login/woovina-popup-login.php',
'name' => 'WooVina Popup Login',
),
array(
'slug' => 'woovina-woo-popup',
'init' => 'woovina-woo-popup/woovina-woo-popup.php',
'name' => 'WooVina Woo Popup',
),
array(
'slug' => 'woovina-variation-swatches',
'init' => 'woovina-variation-swatches/woovina-variation-swatches.php',
'name' => 'WooVina Variation Swatches',
),
),
),
),
'Layout 5' => array(
'demo_class' => 'pro-demo',
'xml_file' => $theme_dir . 'houseware-05/contents.xml',
'theme_settings' => $theme_url . 'houseware-05/customizer.json',
'widgets_file' => $theme_url . 'houseware-05/widgets.wie',
'preview_image' => $theme_url . 'houseware-05/houseware-05.jpg',
'form_file' => $theme_url . 'houseware-05/form.json',
'preview_url' => 'https://houseware.woovina.net/demo-05/',
'home_title' => 'Home',
'blog_title' => 'Blog',
'posts_to_show' => '12',
'elementor_width' => '1200',
'css_file' => 'houseware-05.css',
'woo_image_size' => '600',
'woo_thumb_size' => '250',
'woo_crop_width' => '5',
'woo_crop_height' => '4',
'required_plugins' => array(
'free' => array(
array(
'slug' => 'elementor',
'init' => 'elementor/elementor.php',
'name' => 'Elementor',
),
array(
'slug' => 'woocommerce',
'init' => 'woocommerce/woocommerce.php',
'name' => 'WooCommerce',
),
array(
'slug' => 'wpforms-lite',
'init' => 'wpforms-lite/wpforms.php',
'name' => 'WPForms',
),
),
'premium' => array(
array(
'slug' => 'woovina-sticky-header',
'init' => 'woovina-sticky-header/woovina-sticky-header.php',
'name' => 'WooVina Sticky Header',
),
array(
'slug' => 'woovina-preloader',
'init' => 'woovina-preloader/woovina-preloader.php',
'name' => 'WooVina Preloader',
),
array(
'slug' => 'woovina-product-sharing',
'init' => 'woovina-product-sharing/woovina-product-sharing.php',
'name' => 'WooVina Product Sharing',
),
array(
'slug' => 'woovina-popup-login',
'init' => 'woovina-popup-login/woovina-popup-login.php',
'name' => 'WooVina Popup Login',
),
array(
'slug' => 'woovina-woo-popup',
'init' => 'woovina-woo-popup/woovina-woo-popup.php',
'name' => 'WooVina Woo Popup',
),
array(
'slug' => 'woovina-variation-swatches',
'init' => 'woovina-variation-swatches/woovina-variation-swatches.php',
'name' => 'WooVina Variation Swatches',
),
),
),
),
'Layout 6' => array(
'demo_class' => 'pro-demo',
'xml_file' => $theme_dir . 'houseware-06/contents.xml',
'theme_settings' => $theme_url . 'houseware-06/customizer.json',
'widgets_file' => $theme_url . 'houseware-06/widgets.wie',
'preview_image' => $theme_url . 'houseware-06/houseware-06.jpg',
'form_file' => $theme_url . 'houseware-06/form.json',
'preview_url' => 'https://houseware.woovina.net/demo-06/',
'home_title' => 'Home',
'blog_title' => 'Blog',
'posts_to_show' => '12',
'elementor_width' => '1200',
'css_file' => 'houseware-06.css',
'woo_image_size' => '600',
'woo_thumb_size' => '250',
'woo_crop_width' => '5',
'woo_crop_height' => '4',
'required_plugins' => array(
'free' => array(
array(
'slug' => 'elementor',
'init' => 'elementor/elementor.php',
'name' => 'Elementor',
),
array(
'slug' => 'woocommerce',
'init' => 'woocommerce/woocommerce.php',
'name' => 'WooCommerce',
),
array(
'slug' => 'wpforms-lite',
'init' => 'wpforms-lite/wpforms.php',
'name' => 'WPForms',
),
),
'premium' => array(
array(
'slug' => 'woovina-preloader',
'init' => 'woovina-preloader/woovina-preloader.php',
'name' => 'WooVina Preloader',
),
array(
'slug' => 'woovina-product-sharing',
'init' => 'woovina-product-sharing/woovina-product-sharing.php',
'name' => 'WooVina Product Sharing',
),
array(
'slug' => 'woovina-popup-login',
'init' => 'woovina-popup-login/woovina-popup-login.php',
'name' => 'WooVina Popup Login',
),
array(
'slug' => 'woovina-woo-popup',
'init' => 'woovina-woo-popup/woovina-woo-popup.php',
'name' => 'WooVina Woo Popup',
),
array(
'slug' => 'woovina-variation-swatches',
'init' => 'woovina-variation-swatches/woovina-variation-swatches.php',
'name' => 'WooVina Variation Swatches',
),
),
),
),
'Layout 7' => array(
'demo_class' => 'pro-demo',
'xml_file' => $theme_dir . 'houseware-07/contents.xml',
'theme_settings' => $theme_url . 'houseware-07/customizer.json',
'widgets_file' => $theme_url . 'houseware-07/widgets.wie',
'preview_image' => $theme_url . 'houseware-07/houseware-07.jpg',
'form_file' => $theme_url . 'houseware-07/form.json',
'preview_url' => 'https://houseware.woovina.net/demo-07/',
'home_title' => 'Home',
'blog_title' => 'Blog',
'posts_to_show' => '12',
'elementor_width' => '1200',
'css_file' => 'houseware-07.css',
'woo_image_size' => '600',
'woo_thumb_size' => '250',
'woo_crop_width' => '5',
'woo_crop_height' => '4',
'required_plugins' => array(
'free' => array(
array(
'slug' => 'elementor',
'init' => 'elementor/elementor.php',
'name' => 'Elementor',
),
array(
'slug' => 'woocommerce',
'init' => 'woocommerce/woocommerce.php',
'name' => 'WooCommerce',
),
array(
'slug' => 'wpforms-lite',
'init' => 'wpforms-lite/wpforms.php',
'name' => 'WPForms',
),
),
'premium' => array(
array(
'slug' => 'woovina-preloader',
'init' => 'woovina-preloader/woovina-preloader.php',
'name' => 'WooVina Preloader',
),
array(
'slug' => 'woovina-product-sharing',
'init' => 'woovina-product-sharing/woovina-product-sharing.php',
'name' => 'WooVina Product Sharing',
),
array(
'slug' => 'woovina-popup-login',
'init' => 'woovina-popup-login/woovina-popup-login.php',
'name' => 'WooVina Popup Login',
),
array(
'slug' => 'woovina-woo-popup',
'init' => 'woovina-woo-popup/woovina-woo-popup.php',
'name' => 'WooVina Woo Popup',
),
array(
'slug' => 'woovina-variation-swatches',
'init' => 'woovina-variation-swatches/woovina-variation-swatches.php',
'name' => 'WooVina Variation Swatches',
),
),
),
),
);
// Return
return $data;
}
add_filter('wvn_demos_data', 'houseware_get_demos');