File: /www/wwwroot/pulitocucito.it/wp-content/themes/laundry/functions.php_bak
<?php
/**
* Laundry functions and definitions.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Laundry
*/
if ( ! defined( 'LAUNDRY_THEME_URI' ) ) {
define( 'LAUNDRY_THEME_URI', get_template_directory_uri() );
}
define( 'LAUNDRY_THEME_DIR', get_template_directory() );
define( 'LAUNDRY_CSS_URL', get_template_directory_uri() . '/css' );
define( 'LAUNDRY_JS_URL', get_template_directory_uri() . '/js' );
define( 'LAUNDRY_IMG_URL', LAUNDRY_THEME_URI . '/images' );
define( 'LAUNDRY_INC_DIR', LAUNDRY_THEME_DIR . '/inc' );
define( 'LAUNDRY_FRAMEWORK_DIR', LAUNDRY_THEME_DIR . '/framework' );
define( 'LAUNDRY_EXTERNAL_DIR', LAUNDRY_THEME_DIR . '/external' );
define( 'LAUNDRY_EXTERNAL_URI', get_template_directory_uri() . '/external' );
define( 'LAUNDRY_THEME', true );
/*
* plugin.php has to load to know which plugin is active
*/
require_once ABSPATH . 'wp-admin/includes/plugin.php';
require_once LAUNDRY_INC_DIR . '/framework_customize.php';
if ( ! function_exists( 'laundry_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 laundry_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Laundry, use a find and replace
* to change 'laundry' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'laundry', 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' );
add_theme_support( 'custom-header' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus(
array(
'primary' => esc_html__( 'Primary', 'laundry' ),
)
);
/*
* 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',
)
);
/*
* Enable support for Post Formats.
*/
add_theme_support(
'post-formats',
array(
'gallery',
'audio',
'video',
'link',
'quote',
)
);
// Set up the WordPress core custom background feature.
add_theme_support(
'custom-background',
apply_filters(
'laundry_custom_background_args',
array(
'default-color' => 'ffffff',
'default-image' => '',
)
)
);
add_theme_support( 'wp-block-styles' );
add_theme_support( 'align-wide' );
add_theme_support( 'editor-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'woocommerce' );
add_image_size( 'laundry-gallery-thumbnail', 470, 240, true );
add_image_size( 'laundry-service-full', 870, 553, true );
}
endif;
add_action( 'after_setup_theme', 'laundry_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function laundry_content_width() {
$GLOBALS['content_width'] = apply_filters( 'laundry_content_width', 640 );
}
add_action( 'after_setup_theme', 'laundry_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function laundry_widgets_init() {
$laundry_opt = laundry_get_options();
$theme = isset( $laundry_opt['laundry_demo_select'] ) ? $laundry_opt['laundry_demo_select'] : 1;
if ( $theme == '2' ) {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'laundry' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'laundry' ),
'before_widget' => '<div id="%1$s" class="widget tt-block-aside %2$s"><div class="tt-aside-content">',
'after_widget' => '</div></div>',
'before_title' => '<h3 class="tt-aside-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Service Sidebar', 'laundry' ),
'id' => 'servicesidebar',
'description' => esc_html__( 'Service sidebar area', 'laundry' ),
'before_widget' => '<div id="%1$s" class="widget tt-block-aside %2$s"><div class="tt-aside-content">',
'after_widget' => '</div></div>',
'before_title' => '<h3 class="tt-aside-title">',
'after_title' => '</h3>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Woo Sidebar', 'laundry' ),
'id' => 'woosidebar',
'description' => esc_html__( 'Woo sidebar area', 'laundry' ),
'before_widget' => '<div id="%1$s" class="widget tt-block-aside %2$s"><div class="tt-aside-content">',
'after_widget' => '</div></div>',
'before_title' => '<h3 class="tt-aside-title">',
'after_title' => '</h3>',
)
);
} else {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'laundry' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'laundry' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Service Sidebar', 'laundry' ),
'id' => 'servicesidebar',
'description' => esc_html__( 'Service sidebar area', 'laundry' ),
'before_widget' => '<div id="%1$s" class="widget service-widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h4 class="">',
'after_title' => '</h4>',
)
);
}
}
add_action( 'widgets_init', 'laundry_widgets_init' );
/*
==================================================================================
* --- Enqueue scripts and styles.
* ================================================================================== */
add_action( 'wp_enqueue_scripts', 'laundry_scripts_build' );
function laundry_scripts_build() {
wp_enqueue_style( 'laundry-google-fonts', laundry_google_script(), array(), null );
}
function laundry_google_script() {
global $laundry_opt;
if ( isset( $laundry_opt['laundry-body-typography']['font-family'] ) && $laundry_opt['laundry-body-typography']['font-family']
) {
$fonts_areas = array(
'laundry-body-typography',
'laundry-heading-typography',
);
foreach ( $fonts_areas as $option ) {
$variants = ':100,100i,300,300i,400,400i,500,700,700i,900,900i';
$font_family = $laundry_opt[ $option ]['font-family'] . $variants;
$protocol = is_ssl() ? 'https:' : 'http:';
$subsets = 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese';
$query_args = array(
'family' => urlencode( $font_family ),
'subset' => urlencode( $subsets ),
);
$font_url = add_query_arg( $query_args, $protocol . '//fonts.googleapis.com/css' );
return $font_url;
}
} else {
$theme = $laundry_opt['laundry_demo_select'];
if ( $theme == '2' ) {
$protocol = is_ssl() ? 'https:' : 'http:';
$subsets = 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese';
$variants = ':300,300i,400,400i,500,500i,600,600i,700,700i,900,900i';
$query_args = array(
'family' => urlencode( 'Poppins' . $variants . '|Roboto' . $variants ),
'subset' => urlencode( $subsets ),
);
$font_url = add_query_arg( $query_args, $protocol . '//fonts.googleapis.com/css' );
return $font_url;
} else {
$protocol = is_ssl() ? 'https:' : 'http:';
$subsets = 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese';
$variants = ':100,100i,300,300i,400,400i,700,700i,900,900i';
$query_args = array(
'family' => urlencode( 'Lato' . $variants . '|Rubik' . $variants ),
'subset' => urlencode( $subsets ),
);
$font_url = add_query_arg( $query_args, $protocol . '//fonts.googleapis.com/css' );
return $font_url;
}
}
}
add_action( 'wp_enqueue_scripts', 'laundry_scripts' );
function laundry_scripts() {
global $laundry_opt;
$theme = isset( $laundry_opt['laundry_demo_select'] ) ? $laundry_opt['laundry_demo_select'] : 1;
/*
---------------------------------------------------------------
* CSS Files
* --------------------------------------------------------------- */
if ( $theme == '2' ) {
wp_enqueue_style( 'laundry-blog', LAUNDRY_CSS_URL . '/style-blog.css', null, time() );
wp_enqueue_style( 'laundry-style-2', LAUNDRY_CSS_URL . '/style-2.css', null, time() );
wp_enqueue_style( 'laundry-custom', LAUNDRY_CSS_URL . '/custom.css', null, time() );
include_once LAUNDRY_THEME_DIR . '/css/custom_style-2.php';
} else {
wp_enqueue_style( 'wp-default-norm', LAUNDRY_CSS_URL . '/wp-default-norm.css', '', null );
wp_enqueue_style( 'animate', LAUNDRY_EXTERNAL_URI . '/animate/animate.min.css', '', null );
wp_enqueue_style( 'slick', LAUNDRY_EXTERNAL_URI . '/slick/slick.css', '', null );
wp_enqueue_style( 'slick-theme', LAUNDRY_EXTERNAL_URI . '/slick/slick-theme.css', '', null );
wp_enqueue_style( 'magnific-popup', LAUNDRY_EXTERNAL_URI . '/magnific-popup/magnific-popup.css', '', null );
wp_enqueue_style( 'bootstrap-datetimepicker', LAUNDRY_EXTERNAL_URI . '/magnific-popup/bootstrap-datetimepicker.css', '', null );
wp_enqueue_style( 'laundry-font', LAUNDRY_THEME_URI . '/fonts/style.css', '', null );
wp_enqueue_style( 'bootstrap', LAUNDRY_EXTERNAL_URI . '/bootstrap/bootstrap.min.css', '', null );
wp_enqueue_style( 'laundry-theme-html', LAUNDRY_CSS_URL . '/theme.css', '', null );
wp_enqueue_style( 'laundry-custom', LAUNDRY_CSS_URL . '/custom.css', '', null );
include_once LAUNDRY_THEME_DIR . '/css/custom_style.php';
}
wp_enqueue_style( 'laundry-shop', LAUNDRY_CSS_URL . '/shop.css', '', time(), null );
$styles = laundry_services_get_custom_styles();
wp_add_inline_style( 'laundry-custom', $styles );
/*
----------------------------------------------------------------
* JS Files
* ---------------------------------------------------------------- */
if ( $theme == '2' ) {
wp_enqueue_script( 'laundry-bundle-js', LAUNDRY_JS_URL . '/bundle.js', array( 'jquery' ), time(), true );
wp_localize_script(
'laundry-bundle-js',
'ajax_object',
array(
'ajax_nonce_servicecart' => wp_create_nonce( 'servicecart' ),
'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
)
);
} else {
wp_enqueue_script( 'bootstrap', LAUNDRY_EXTERNAL_URI . '/bootstrap/bootstrap.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'slick', LAUNDRY_EXTERNAL_URI . '/slick/slick.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'waypoints', LAUNDRY_EXTERNAL_URI . '/waypoints/jquery.waypoints.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'countTo', LAUNDRY_EXTERNAL_URI . '/countto/jquery.countTo.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'imagesloaded', LAUNDRY_EXTERNAL_URI . '/imagesloaded/imagesloaded.pkgd.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'moment', LAUNDRY_JS_URL . '/moment.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'isotope', LAUNDRY_EXTERNAL_URI . '/masonry/isotope.pkgd.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'laundry-main-js', LAUNDRY_JS_URL . '/main.js', array( 'jquery' ), filemtime( LAUNDRY_THEME_DIR . '/js/main.js' ), true );
wp_localize_script(
'laundry-main-js',
'ajax_object',
array(
'ajax_nonce_coupon' => wp_create_nonce( 'coupon' ),
'ajax_url' => esc_url( admin_url( 'admin-ajax.php' ) ),
)
);
wp_enqueue_style( 'ie_html5shiv', LAUNDRY_THEME_URI . '/js/html5shiv.js' );
wp_style_add_data( 'ie_html5shiv', 'conditional', 'lt IE 9' );
wp_enqueue_style( 'respond', LAUNDRY_THEME_URI . '/js/respond.min.js' );
wp_style_add_data( 'respond', 'conditional', 'lt IE 9' );
wp_localize_script(
'laundry-main-js',
'ajax_posts',
array(
'ajax_nonce_postloadmore' => wp_create_nonce( 'postloadmore' ),
'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ),
'noposts' => esc_html__( 'No older posts found', 'laundry' ),
)
);
wp_enqueue_script( 'laundry-navigation', LAUNDRY_JS_URL . '/navigation.js', array(), filemtime( LAUNDRY_THEME_DIR . '/js/navigation.js' ), true );
wp_enqueue_script( 'laundry-skip-link-focus-fix', LAUNDRY_JS_URL . '/skip-link-focus-fix.js', array(), filemtime( LAUNDRY_THEME_DIR . '/js/skip-link-focus-fix.js' ), true );
wp_enqueue_script( 'magnific-popup', LAUNDRY_JS_URL . '/magnific-popup.min.js', array( 'jquery' ), '', true );
wp_enqueue_script( 'bootstrap-datetimepicker', LAUNDRY_JS_URL . '/bootstrap-datetimepicker.min.js', array( 'jquery' ), '', true );
}
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_script( 'laundry-custom', LAUNDRY_JS_URL . '/custom.js', array( 'jquery' ), filemtime( LAUNDRY_THEME_DIR . '/js/custom.js' ), true );
// Load script
if ( isset( $laundry_opt['laundry-display-gmap'] ) && $laundry_opt['laundry-display-gmap'] ) {
$apikey = $laundry_opt['laundry-gmap-api-key'];
wp_enqueue_script( 'laundry-contact-googlemap', '//maps.googleapis.com/maps/api/js?sensor=false&key=' . $apikey, array(), '201202124', false );
$gmap_vars = array(
'GMAP_LAT' => $laundry_opt['laundry-gmap-latitude'],
'GMAP_LNG' => $laundry_opt['laundry-gmap-longitude'],
'GMAP_ZOOM' => $laundry_opt['laundry-gmap-zoom'],
'GMAP_THEME_PATH' => LAUNDRY_THEME_URI,
);
wp_localize_script( 'laundry-contact-googlemap', 'laundry_gmap_vars', $gmap_vars );
}
}
function laundry_repair_add_to_cart_fragment( $fragments ) {
ob_start();
$count = WC()->cart->cart_contents_count;
?>
<a href="<?php echo get_permalink( wc_get_page_id( 'cart' ) ); ?>" class="tt-obj__btn cart-contents">
<i class="icons-711897"></i>
<?php if ( $count > 0 ) : ?>
<div class="tt-obj__badge badge cart-contents-count"><?php echo esc_html( $count ); ?></div>
<?php endif; ?>
</a>
<?php
$fragments['a.cart-contents'] = ob_get_clean();
return $fragments;
}
add_filter( 'woocommerce_add_to_cart_fragments', 'laundry_repair_add_to_cart_fragment' );
// service cart add
require_once LAUNDRY_INC_DIR . '/priceclass.php';
add_filter( 'woocommerce_add_cart_item', 'laundry_service_add_cart_item', 10, 2 );
if ( ! function_exists( 'laundry_service_add_cart_item' ) ) {
function laundry_service_add_cart_item( $cart_item, $cart_id ) {
$post_type = get_post_type( $cart_item['data']->get_id() );
$cart_item['data']->set_props(
array(
'product_id' => $cart_item['product_id'],
// 'check_in_date' => $cart_item['check_in_date'],
// 'check_out_date' => $cart_item['check_out_date'],
'woo_cart_id' => $cart_id,
)
);
return $cart_item;
}
}
add_filter( 'woocommerce_product_class', 'laundry_service_product_class', 10, 4 );
if ( ! function_exists( 'laundry_service_product_class' ) ) {
function laundry_service_product_class( $classname, $product_type, $post_type, $product_id ) {
if ( 'product' != get_post_type( $product_id ) ) {
$classname = 'CR_WC_Product_Device';
}
return $classname;
}
}
add_action( 'wp_ajax_service_add_to_cart', 'laundry_service_add_to_cart' );
add_action( 'wp_ajax_nopriv_service_add_to_cart', 'laundry_service_add_to_cart' );
if ( ! function_exists( 'laundry_service_add_to_cart' ) ) {
function laundry_service_add_to_cart() {
global $woocommerce;
if ( ! $woocommerce || ! $woocommerce->cart ) {
return $_POST['product_id'];
}
WC()->session->set( 'custom_price' . (int) $_POST['product_id'], ( $_POST['price'] ) );
WC()->session->set( 'service_name' . (int) $_POST['product_id'], ( $_POST['service_name'] ) );
WC()->session->set( 'service_type' . (int) $_POST['product_id'], ( $_POST['service_type'] ) );
$cart_items = $woocommerce->cart->get_cart();
$woo_cart_param = array(
'product_id' => $_POST['product_id'],
'check_in_date' => '',
'check_out_date' => '',
'quantity' => $_POST['quantity'],
'service_name' => $_POST['service_name'],
'service_type' => $_POST['service_type'],
'custom_price' => $_POST['price'],
);
$woo_cart_id = $woocommerce->cart->generate_cart_id( $woo_cart_param['product_id'], null, array(), $woo_cart_param );
if ( array_key_exists( $woo_cart_id, $cart_items ) ) {
$woocommerce->cart->set_quantity( $woo_cart_id, $_POST['quantity'] );
} else {
$woocommerce->cart->add_to_cart( $woo_cart_param['product_id'], $woo_cart_param['quantity'], null, array(), $woo_cart_param );
}
$woocommerce->cart->calculate_totals();
// Save cart to session
$woocommerce->cart->set_session();
// Maybe set cart cookies
$woocommerce->cart->maybe_set_cart_cookies();
echo 'success';
wp_die();
}
}
function laundry_add_google_font() {
wp_enqueue_style( 'laundry-google-fonts-admin', laundry_build_google_font(), array(), null );
}
add_action( 'admin_enqueue_scripts', 'laundry_add_google_font' );
function laundry_build_google_font() {
$protocol = is_ssl() ? 'https:' : 'http:';
$subsets = 'latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese';
$query_args = array(
'family' => urlencode( 'Lato:300,400,700,900|Rubik:300,400,500,700' ),
'subset' => urlencode( $subsets ),
);
$font_url = add_query_arg( $query_args, $protocol . '//fonts.googleapis.com/css' );
return $font_url;
}
add_action( 'admin_enqueue_scripts', 'laundry_admin_enqueue' );
function laundry_admin_enqueue() {
wp_enqueue_style( 'laundry-admin-iconfont', get_template_directory_uri() . '/fonts/style.css', '', null );
wp_enqueue_style( 'laundry-admin', get_template_directory_uri() . '/css/admin.css', '', null );
wp_enqueue_style( 'laundry-block-styles', get_theme_file_uri( 'css/all-block.css' ), false, '1.0', 'all' );
}
function laundry_add_editor_styles() {
add_editor_style( 'editor-style.css' );
}
add_action( 'admin_init', 'laundry_add_editor_styles' );
function laundry_gutenberg_editor_palette_styles() {
add_theme_support(
'editor-color-palette',
array(
array(
'name' => esc_html__( 'strong yellow', 'laundry' ),
'slug' => 'strong-yellow',
'color' => '#f7bd00',
),
array(
'name' => esc_html__( 'strong white', 'laundry' ),
'slug' => 'strong-white',
'color' => '#fff',
),
array(
'name' => esc_html__( 'light black', 'laundry' ),
'slug' => 'light-black',
'color' => '#242424',
),
array(
'name' => esc_html__( 'very light gray', 'laundry' ),
'slug' => 'very-light-gray',
'color' => '#797979',
),
array(
'name' => esc_html__( 'very dark black', 'laundry' ),
'slug' => 'very-dark-black',
'color' => '#000000',
),
)
);
add_theme_support(
'editor-font-sizes',
array(
array(
'name' => esc_html__( 'Small', 'laundry' ),
'size' => 10,
'slug' => 'small',
),
array(
'name' => esc_html__( 'Normal', 'laundry' ),
'size' => 15,
'slug' => 'normal',
),
array(
'name' => esc_html__( 'Large', 'laundry' ),
'size' => 24,
'slug' => 'large',
),
array(
'name' => esc_html__( 'Huge', 'laundry' ),
'size' => 36,
'slug' => 'huge',
),
)
);
}
add_action( 'after_setup_theme', 'laundry_gutenberg_editor_palette_styles' );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/*
==================================================================================
* --- Redux Option filds
* ================================================================================== */
require_once LAUNDRY_INC_DIR . '/redux.fallback.php';
require_once LAUNDRY_INC_DIR . '/redux.config.php';
require_once LAUNDRY_FRAMEWORK_DIR . '/plugin-list.php';
/*
* Enable support TGM features.
*/
require_once LAUNDRY_FRAMEWORK_DIR . '/tgm/class-tgm-plugin-activation.php';
/*
* Enable support TGM configuration.
*/
require_once LAUNDRY_FRAMEWORK_DIR . '/tgm/config.tgm.php';
require_once LAUNDRY_FRAMEWORK_DIR . '/dashboard/class-dashboard.php';
/*
==================================================================================
* --- nav_menu_walker
* ================================================================================== */
if ( file_exists( LAUNDRY_INC_DIR . '/nav_menu_walker.php' ) ) {
include_once LAUNDRY_INC_DIR . '/nav_menu_walker.php';
} else {
add_action(
'admin_notices',
function () {
echo '
<div class="error">
<p><strong>/inc/nav_menu_walker.php</strong> ' . esc_html__( 'File not exist in theme !!', 'laundry' ) . '</p>
</div>
';
}
);
}
/*
* Meta Box Configuration Post Meta Option
*/
if ( file_exists( LAUNDRY_INC_DIR . '/config.meta.box.php' ) ) {
include_once LAUNDRY_INC_DIR . '/config.meta.box.php';
} else {
add_action(
'admin_notices',
function () {
echo '
<div class="error">
<p><strong>/inc/config.meta.box.php</strong> ' . esc_html__( 'File not exist in theme !!', 'laundry' ) . '</p>
</div>
';
}
);
}
/**
* comment walker.
*/
require get_template_directory() . '/inc/class-walker-comment.php';
if ( function_exists( 'vc_parse_multi_attribute' ) ) {
function vc_map_loop_parse_attributes( $value ) {
$values = vc_parse_multi_attribute(
$value,
array(
'size' => isset( $fields['size'] ) ? $fields['size'] : '',
'post_type' => isset( $fields['post_type'] ) ? $fields['post_type'] : '',
'order_by' => isset( $fields['order_by'] ) ? $fields['order_by'] : '',
'order' => isset( $fields['order'] ) ? $fields['order'] : '',
'categories_autosuggest' => isset( $fields['categories_autosuggest'] ) ? $fields['categories_autosuggest'] : '',
'tags_autosuggest' => isset( $fields['tags_autosuggest'] ) ? $fields['tags_autosuggest'] : '',
'tax_query_autosuggest' => isset( $fields['tax_query_autosuggest'] ) ? $fields['tax_query_autosuggest'] : '',
'by_id_autosuggest' => isset( $fields['post_type'] ) ? $fields['by_id_autosuggest'] : '',
'authors_autosuggest' => isset( $fields['authors_autosuggest'] ) ? $fields['post_type'] : '',
)
);
return $values;
}
}
/*
* ****************************************************************
* Ajax Posts loading
* ***************************************************************** */
function laundry_more_post_ajax() {
check_ajax_referer( 'postloadmore', 'security' );
if ( isset( $_POST['pageNumber'] ) ) {
$pageNumber = $_POST['pageNumber'];
} else {
$pageNumber = '';
};
if ( isset( $_POST['posts_per_page'] ) ) {
$posts_per_page = $_POST['posts_per_page'];
} else {
$posts_per_page = '';
};
// WP_Query arguments
$args = array(
'post_type' => array( 'post' ),
'post_status' => array( 'publish' ),
'nopaging' => false,
'paged' => $pageNumber,
'posts_per_page' => $posts_per_page,
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
?>
<div class="blog-post">
<div class="post-image">
<?php get_template_part( 'template-parts/media/content', get_post_format() ); ?>
</div>
<div class="post-content">
<ul class="post-meta">
<li class="post-message"><i class="icon icon-chat-bubble"></i><span><?php comments_number( '0', '1', '%' ); ?></span></li>
<li><a href="<?php the_permalink(); ?>"><?php echo get_the_date( 'd / m / Y' ); ?></a></li>
</ul>
<h3 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="post-author"><?php esc_html_e( 'by', 'laundry' ); ?> <?php printf( esc_html__( '%s', 'laundry' ), get_the_author() ); ?></div>
<div class="post-teaser">
<p><?php the_excerpt(); ?></p>
</div>
</div>
</div>
<?php
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
die();
}
add_action( 'wp_ajax_laundry_more_post_ajax', 'laundry_more_post_ajax' );
add_action( 'wp_ajax_nopriv_laundry_more_post_ajax', 'laundry_more_post_ajax' );
function laundry_gallery_ajax() {
if ( isset( $_POST['pageNumber'] ) ) {
$pageNumber = $_POST['pageNumber'];
} else {
$pageNumber = '';
};
if ( isset( $_POST['posts_per_page'] ) ) {
$posts_per_page = $_POST['posts_per_page'];
} else {
$posts_per_page = '';
};
// WP_Query arguments
$args = array(
'post_type' => array( 'post' ),
'post_status' => array( 'publish' ),
'nopaging' => false,
'paged' => $pageNumber,
'posts_per_page' => $posts_per_page,
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
$img_meta = wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) );
$wh_ratio = $img_meta['width'] * 1 / $img_meta['height'] * 1;
$grid_class = '';
$thumb_size = 'medium';
$proj_thumb_size = get_post_meta( get_the_ID(), 'framework-thumbnail-size' );
if ( $proj_thumb_size[0] != '' ) {
if ( $proj_thumb_size[0] == 'big_squier' ) {
$grid_class = 'doubleW';
$grid_class .= ' doubleH';
$thumb_size = 'large';
} elseif ( $proj_thumb_size[0] == 'single_hor' ) {
$grid_class = 'doubleW';
$thumb_size = 'large';
} elseif ( $proj_thumb_size[0] == 'single_var' ) {
$grid_class = 'doubleH';
$thumb_size = 'large';
} else {
$grid_class = '';
$thumb_size = 'medium';
}
if ( $sl == 1 ) {
$grid_class = '';
}
} else {
if ( $wh_ratio < 0.75 ) {
if ( $img_meta['height'] > 340 ) {
$grid_class = 'doubleH';
$thumb_size = 'large';
} else {
$grid_class = '';
$thumb_size = 'medium';
}
} elseif ( $wh_ratio >= 0.75 && $wh_ratio <= 1.75 ) {
if ( $img_meta['width'] <= 420 || $img_meta['height'] <= 420 ) {
$grid_class = '';
$thumb_size = 'thumb_225x180';
} else {
$grid_class = 'doubleW';
$grid_class .= ' doubleH';
$thumb_size = 'large';
}
} elseif ( $wh_ratio > 1.75 ) {
if ( $img_meta['width'] > 430 ) {
$grid_class = 'doubleW';
$thumb_size = 'large';
} else {
$grid_class = '';
$thumb_size = 'medium';
}
}
if ( $sl == 1 ) {
$grid_class = '';
}
}
?>
<div class="gallery__item <?php echo esc_attr( $grid_class ); ?>">
<div class="gallery__item__image">
<?php
$gi_lg = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'large' );
$gi_auto = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), $thumb_size );
?>
<img src="<?php echo esc_url( $gi_auto[0] ); ?>" alt="gallery image" />
<a class="btn btn-lg" href="<?php echo esc_url( $gi_lg[0] ); ?>"><?php esc_html_e( 'zoom', 'laundry' ); ?></a>
</div>
</div>
<?php
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
die();
}
add_action( 'wp_ajax_laundry_gallery_ajax', 'laundry_gallery_ajax' );
add_action( 'wp_ajax_nopriv_laundry_gallery_ajax', 'laundry_gallery_ajax' );
function landry_tag_cloud_widget() {
$tag_args = array(
'format' => 'list',
'echo' => false,
);
return $tag_args;
}
add_filter( 'widget_tag_cloud_args', 'landry_tag_cloud_widget' );
add_filter( 'comment_reply_link', 'laundry_replace_reply_link_class' );
function laundry_replace_reply_link_class( $class ) {
$class = str_replace( "class='comment-reply-link", "class='reply", $class );
return $class;
}
function laundry_select_svg( $svg_name ) {
switch ( $svg_name ) {
case 'washing-machine':
return '<svg class="svg-washer-icon" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" viewBox="0 0 32 32">
<path d="M29 29c0 1.519-1.231 2.75-2.75 2.75h-20.5c-1.519 0-2.75-1.231-2.75-2.75v-26c0-1.519 1.231-2.75 2.75-2.75h20.5c1.519 0 2.75 1.231 2.75 2.75v26zM27.5 3c0-0.69-0.56-1.25-1.25-1.25h-20.5c-0.69 0-1.25 0.56-1.25 1.25v26c0 0.69 0.56 1.25 1.25 1.25h20.5c0.69 0 1.25-0.56 1.25-1.25v-26z"></path>
<path d="M28.036 9.75h-24.5c-0.414 0-0.537-0.336-0.537-0.75v-5.76c0-1.537 1.226-2.99 2.749-2.99h20.31c1.607 0 2.94 1.576 2.94 2.99v5.76c0 0.414-0.55 0.75-0.964 0.75zM4.5 8.25h23v-5.009c0-0.675-0.761-1.491-1.44-1.491h-20.31c-0.684 0-1.249 0.794-1.249 1.491v5.009z"></path>
<path d="M11.75 9.5c-0.414 0-0.75-0.336-0.75-0.75v-7.5c0-0.414 0.336-0.75 0.75-0.75s0.75 0.336 0.75 0.75v7.5c0 0.414-0.336 0.75-0.75 0.75z"></path>
<path d="M25.603 5.12c0 0.714-0.578 1.293-1.293 1.293s-1.293-0.579-1.293-1.293c0-0.714 0.578-1.293 1.293-1.293s1.293 0.579 1.293 1.293z"></path>
<path d="M21.982 5.12c0 0.714-0.578 1.293-1.293 1.293s-1.293-0.579-1.293-1.293c0-0.714 0.578-1.293 1.293-1.293s1.293 0.579 1.293 1.293z"></path>
<path d="M18.362 5.12c0 0.714-0.58 1.293-1.293 1.293-0.714 0-1.293-0.579-1.293-1.293s0.578-1.293 1.293-1.293c0.714 0 1.293 0.579 1.293 1.293z"></path>
<g class="disc">
<path d="M15.613 27.917c-3.961 0-7.183-3.222-7.183-7.183s3.222-7.183 7.183-7.183c3.96 0 7.183 3.222 7.183 7.183s-3.223 7.183-7.183 7.183zM15.613 15.051c-3.134 0-5.683 2.549-5.683 5.683s2.55 5.683 5.683 5.683c3.133 0 5.683-2.55 5.683-5.683s-2.55-5.683-5.683-5.683z"></path>
<path d="M12.876 23.106c-1.754 0-3.277-1.023-4.047-1.842-0.284-0.302-0.27-0.776 0.032-1.060 0.3-0.284 0.774-0.271 1.058 0.030v0c0.104 0.109 2.57 2.636 5.094 0.521 2.857-2.391 5.86-1.037 7.047 0.013 0.31 0.274 0.34 0.748 0.066 1.058s-0.749 0.34-1.058 0.066c-0.099-0.087-2.521-2.139-5.091 0.013-1.045 0.875-2.11 1.201-3.1 1.201z"></path>
<path d="M19.655 22.189c0 0.286-0.231 0.517-0.517 0.517s-0.517-0.231-0.517-0.517c0-0.285 0.231-0.517 0.517-0.517s0.517 0.231 0.517 0.517z"></path>
<path d="M19.137 24.258c0 0.285-0.231 0.517-0.517 0.517s-0.517-0.232-0.517-0.517 0.232-0.517 0.517-0.517c0.285 0 0.517 0.231 0.517 0.517z"></path>
<path d="M17.068 22.706c0 0.285-0.231 0.517-0.517 0.517s-0.517-0.231-0.517-0.517c0-0.286 0.231-0.517 0.517-0.517s0.517 0.231 0.517 0.517z"></path>
<path d="M16.034 24.775c0 0.285-0.231 0.517-0.517 0.517s-0.517-0.231-0.517-0.517c0-0.286 0.231-0.517 0.517-0.517s0.517 0.231 0.517 0.517z"></path>
<path d="M12.93 23.74c0 0.285-0.231 0.517-0.517 0.517s-0.517-0.231-0.517-0.517 0.231-0.517 0.517-0.517c0.286 0 0.517 0.232 0.517 0.517z"></path>
</g>
</svg>';
break;
case 'hanger-with-clothes':
return '<svg class="svg-hanger-icon" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" viewBox="0 0 35 32">
<path class="hanger" d="M32.702 20.62l-13.413-12.155c-0.15-0.137-0.316-0.252-0.489-0.352v-1.965h-0.128c-0.088-0.27-0.301-0.497-0.673-0.583-0.831-0.191-1.748-0.465-2.315-1.143-0.274-0.328-0.359-0.76-0.242-0.988 0.664-1.294 2.593-0.9 3.702-0.421 1.181 0.51 2.21-1.211 1.019-1.725-2.057-0.889-5.404-1.289-6.511 1.245-0.855 1.956 0.436 3.464 2.078 4.32v1.245c-0.184 0.104-0.36 0.223-0.52 0.367l-13.411 12.155c-1.127 1.021-0.748 1.849 0.845 1.849h6.377v-2.155h-3.674l11.312-10.251c0.145-0.132 0.361-0.208 0.592-0.208s0.447 0.075 0.592 0.208l11.312 10.251h-3.747v2.155h6.45c1.593 0 1.971-0.828 0.845-1.849z"></path>
<path class="clothes" d="M10.097 20.314v11.686l3.376-1.023-0.031-6.447c-0.003-0.594 0.477-1.081 1.072-1.083 0.002 0 0.004 0 0.005 0 0.593 0 1.075 0.479 1.077 1.072l0.028 5.806 8.704-2.636v-9.561h-14.232v2.186z"></path>
</svg>';
break;
case 'vacuum-cleaner':
return '<svg class="svg-vacuumcleaner-icon animated-icon" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" viewBox="0 0 39 32">
<path class="tube" d="M37.644 31.192h-9.893c-0.259-1.001 0.157-1.911 0.717-2.333 0.567-0.428 1.67-0.211 2.641-0.338-0.084-0.428-0.199-0.965-0.386-1.344-4.045-8.229-8.121-16.452-12.166-24.681-0.223-0.458-0.705-0.729-1.212-0.699-0.567 0.030-1.145 0.006-1.766 0.006v-1.718c1.121 0 2.267-0.084 3.388 0.048 0.35 0.042 0.717 0.621 0.922 1.037 2.888 5.787 5.745 11.593 8.615 17.393 1.248 2.526 2.514 5.046 3.732 7.59 0.338 0.705 0.663 1.459 0.983 2.399 0.416 0 0.826 0.012 1.459 0.018 1.019 0.012 1.447 0.241 2.020 0.965 0.47 0.591 0.627 0.904 1.031 1.537-0.042 0.048-0.054 0.060-0.084 0.121z"></path>
<path class="hose" d="M14.12 0.898c0 0.41 0 0.711 0 0.892-0.953 0.362-1.887 0.591-2.701 1.043-1.616 0.892-2.182 2.417-1.682 4.184 0.518 1.833 1.718 3.231 2.99 4.576 3.286 3.473 6.601 6.921 9.863 10.412 0.603 0.645 1.097 1.411 1.513 2.194 1.278 2.436 0.32 4.105-2.496 4.317 0-0.326 0-0.651 0-0.983 0.036-0.024 0.078-0.072 0.127-0.078 1.857-0.247 2.363-1.079 1.411-2.695-0.723-1.224-1.634-2.369-2.604-3.418-3.153-3.4-6.402-6.71-9.543-10.116-0.784-0.85-1.429-1.893-1.917-2.948-1.495-3.255-0.006-6.246 3.466-7.138 0.494-0.115 1.007-0.151 1.573-0.241z"></path>
<path class="vacuumcleaner" d="M7.049 20.883c-3.069 0-5.558 2.49-5.558 5.558s2.49 5.558 5.558 5.558c3.069 0 5.558-2.49 5.558-5.558s-2.49-5.558-5.558-5.558zM7.049 29.468c-1.67 0-3.026-1.356-3.026-3.026s1.356-3.026 3.026-3.026c1.67 0 3.026 1.356 3.026 3.026s-1.356 3.026-3.026 3.026z"></path>
<path class="vacuumcleaner" d="M19.48 23.059c-1.748-1.272-3.442-2.616-5.227-3.828-0.663-0.452-1.501-0.868-2.279-0.904-2.616-0.115-5.245-0.066-7.867-0.036-0.669 0.006-1.17 0.398-1.23 1.103-0.054 0.681-0.018 1.375-0.012 2.176 1.157-1.043 2.683-1.682 4.365-1.682 3.593 0 6.511 2.912 6.511 6.511 0 1.338-0.404 2.586-1.097 3.617 2.393 0 4.769 0.030 7.144-0.024 0.748-0.018 1.037-0.639 1.049-1.35 0.012-0.953-0.024-1.905 0.012-2.852 0.018-1.164-0.434-2.050-1.369-2.731z"></path>
</svg>';
break;
case 'shirt':
return '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" width="300" height="300" viewBox="0 0 32 32">
<path d="M15.462 0c0.372 0 0.745 0 1.117 0 0.036 0.005 0.071 0.015 0.107 0.015 0.378 0.010 0.75 0.051 1.117 0.107 0.459 0.066 0.908 0.173 1.337 0.347 0.255 0.102 0.5 0.225 0.719 0.388 0.184 0.138 0.316 0.321 0.454 0.5 0.587 0.76 1.173 1.52 1.755 2.281 0.046 0.056 0.102 0.097 0.168 0.127 0.383 0.173 0.765 0.342 1.143 0.52 0.806 0.378 1.597 0.776 2.357 1.235 0.219 0.133 0.444 0.276 0.648 0.434 0.321 0.255 0.571 0.582 0.821 0.908 0.449 0.592 0.852 1.219 1.235 1.857 0.832 1.372 1.597 2.786 2.327 4.209 0.097 0.189 0.194 0.378 0.291 0.566 0 0.015 0 0.025 0 0.041-0.031 0.077-0.061 0.153-0.097 0.23-0.179 0.388-0.434 0.725-0.73 1.031-0.515 0.541-1.128 0.939-1.806 1.255-0.837 0.388-1.719 0.612-2.633 0.73-0.087 0.010-0.173 0.020-0.255 0.031-0.255-0.342-0.505-0.673-0.755-1.005-0.163-0.214-0.327-0.434-0.485-0.648-0.071-0.092-0.158-0.133-0.276-0.097-0.112 0.031-0.173 0.107-0.189 0.245-0.010 0.112-0.020 0.225-0.025 0.332-0.025 0.525-0.056 1.046-0.071 1.571-0.031 1.184-0.010 2.367 0.056 3.551 0.020 0.378 0.046 0.755 0.077 1.133 0.025 0.372 0.056 0.75 0.092 1.122 0.046 0.48 0.097 0.954 0.153 1.429 0.056 0.495 0.117 0.985 0.189 1.48 0.102 0.689 0.219 1.372 0.337 2.061 0.168 0.954 0.378 1.903 0.633 2.837 0.015 0.066 0.036 0.128 0.056 0.204-0.163 0.061-0.321 0.122-0.48 0.173-0.439 0.143-0.898 0.23-1.352 0.301s-0.913 0.133-1.372 0.189c-0.378 0.046-0.75 0.082-1.128 0.117-0.372 0.031-0.75 0.061-1.122 0.082-0.464 0.025-0.934 0.046-1.398 0.066-0.296 0.010-0.587 0.015-0.883 0.025-0.102 0.005-0.209 0.010-0.311 0.020-0.852 0-1.704 0-2.556 0-0.020-0.005-0.041-0.010-0.061-0.010-0.525-0.015-1.046-0.031-1.571-0.051-0.423-0.015-0.842-0.041-1.265-0.066-0.194-0.010-0.393-0.025-0.587-0.041-0.332-0.031-0.663-0.061-1-0.092-0.265-0.025-0.531-0.051-0.796-0.087-0.342-0.046-0.689-0.097-1.031-0.158-0.398-0.066-0.796-0.143-1.184-0.265-0.184-0.056-0.362-0.128-0.541-0.189 0.010-0.046 0.020-0.077 0.025-0.107 0.418-1.515 0.709-3.056 0.939-4.612 0.087-0.577 0.158-1.153 0.23-1.73 0.056-0.474 0.107-0.944 0.153-1.418 0.041-0.449 0.077-0.893 0.107-1.342 0.036-0.531 0.066-1.066 0.092-1.597 0.015-0.332 0.025-0.663 0.031-0.995 0.005-0.612 0.015-1.224 0.005-1.837-0.010-0.597-0.046-1.194-0.071-1.791-0.005-0.122-0.020-0.24-0.041-0.362-0.015-0.092-0.077-0.143-0.168-0.168-0.117-0.031-0.204 0-0.286 0.112-0.265 0.352-0.525 0.704-0.791 1.056-0.148 0.194-0.291 0.388-0.444 0.592-0.163-0.025-0.327-0.046-0.49-0.071-0.597-0.082-1.179-0.225-1.745-0.429-0.862-0.311-1.658-0.74-2.321-1.388-0.398-0.388-0.735-0.811-0.934-1.332-0.005-0.015-0.025-0.025-0.041-0.036 0-0.020 0-0.041 0-0.061 0.020-0.020 0.041-0.041 0.056-0.066 0.327-0.628 0.648-1.255 0.98-1.878 0.643-1.209 1.316-2.398 2.056-3.551 0.342-0.531 0.699-1.056 1.107-1.536 0.225-0.265 0.459-0.515 0.755-0.699 0.235-0.143 0.464-0.291 0.699-0.429 1.015-0.582 2.077-1.082 3.148-1.551 0.097-0.041 0.173-0.102 0.235-0.184 0.296-0.388 0.592-0.77 0.893-1.158 0.296-0.383 0.597-0.76 0.883-1.153 0.184-0.245 0.398-0.449 0.663-0.597 0.367-0.204 0.755-0.342 1.158-0.444 0.546-0.133 1.102-0.199 1.663-0.225 0.082-0.041 0.153-0.051 0.225-0.056zM21.258 11.664c-0.031-0.031-0.046-0.051-0.066-0.071-1.092-1.367-2.179-2.735-3.27-4.097-0.163-0.204-0.332-0.413-0.495-0.617-0.077-0.097-0.173-0.138-0.291-0.102-0.179 0.056-0.362 0.107-0.541 0.163-0.071 0.025-0.117 0.077-0.133 0.153-0.015 0.061-0.020 0.128-0.020 0.189 0 7.821 0 15.643 0 23.464 0 0.025 0 0.056 0 0.082 0.015 0.194 0.112 0.286 0.306 0.286 0.107 0 0.214 0 0.327-0.005 0.454-0.010 0.913-0.015 1.367-0.031 0.408-0.015 0.816-0.036 1.224-0.056 0.24-0.010 0.48-0.025 0.719-0.046 0.296-0.020 0.592-0.046 0.888-0.077 0.291-0.025 0.577-0.056 0.867-0.087 0.286-0.036 0.571-0.071 0.852-0.117 0.347-0.056 0.689-0.122 1.036-0.189 0.133-0.025 0.194-0.097 0.209-0.225 0.005-0.046-0.010-0.092-0.020-0.138-0.097-0.454-0.204-0.908-0.296-1.367-0.179-0.888-0.332-1.781-0.454-2.679-0.082-0.607-0.163-1.214-0.235-1.821-0.061-0.515-0.107-1.031-0.153-1.546-0.051-0.628-0.097-1.255-0.133-1.883-0.031-0.525-0.046-1.046-0.061-1.571-0.020-0.959-0.015-1.918 0.025-2.877 0.031-0.694 0.077-1.388 0.143-2.082 0.061-0.628 0.143-1.255 0.245-1.878 0.133-0.806 0.296-1.602 0.51-2.388 0.281-1.005 0.628-1.985 1.097-2.913 0.102-0.204 0.214-0.398 0.321-0.597 0.087-0.163 0.056-0.301-0.102-0.398-0.031-0.020-0.056-0.036-0.087-0.051-0.714-0.413-1.459-0.781-2.209-1.133-0.107-0.051-0.214-0.097-0.321-0.143-0.143-0.061-0.327 0.031-0.347 0.204-0.020 0.194-0.051 0.388-0.082 0.582-0.087 0.617-0.173 1.24-0.255 1.857-0.092 0.668-0.179 1.332-0.27 2-0.087 0.638-0.173 1.281-0.26 1.918-0.005 0.092-0.020 0.179-0.036 0.286zM10.778 11.664c-0.010-0.051-0.015-0.087-0.020-0.122-0.010-0.077-0.020-0.153-0.031-0.23-0.051-0.372-0.102-0.745-0.153-1.112s-0.102-0.735-0.153-1.102c-0.056-0.423-0.117-0.842-0.173-1.265-0.051-0.372-0.102-0.75-0.153-1.122-0.051-0.367-0.102-0.735-0.153-1.102-0.025-0.199-0.051-0.398-0.087-0.592-0.031-0.158-0.158-0.23-0.311-0.189-0.036 0.010-0.071 0.020-0.107 0.036-0.689 0.316-1.367 0.643-2.031 1.005-0.173 0.092-0.342 0.194-0.51 0.291-0.082 0.046-0.138 0.107-0.148 0.204-0.010 0.077 0.015 0.138 0.051 0.204 0.107 0.194 0.214 0.388 0.316 0.587 0.577 1.148 0.985 2.362 1.281 3.612 0.225 0.929 0.378 1.872 0.495 2.821 0.082 0.689 0.148 1.378 0.184 2.071 0.031 0.592 0.056 1.189 0.066 1.781 0.020 0.816 0.010 1.628-0.031 2.444-0.031 0.653-0.061 1.301-0.102 1.954-0.036 0.561-0.087 1.128-0.143 1.689-0.066 0.648-0.138 1.296-0.225 1.944-0.092 0.679-0.194 1.357-0.301 2.036-0.143 0.908-0.327 1.806-0.536 2.704-0.036 0.158 0.036 0.286 0.199 0.316 0.296 0.061 0.587 0.117 0.888 0.163 0.372 0.056 0.75 0.107 1.122 0.148 0.378 0.046 0.76 0.082 1.138 0.112 0.342 0.031 0.689 0.051 1.031 0.066 0.5 0.025 1 0.056 1.5 0.071 0.536 0.015 1.066 0.020 1.602 0.031 0.036 0 0.077 0 0.112-0.010 0.092-0.020 0.158-0.077 0.179-0.173 0.010-0.061 0.015-0.128 0.015-0.189 0-4.541 0-9.082 0-13.622 0-3.275 0-6.551 0-9.832 0-0.056 0-0.117-0.010-0.173-0.020-0.097-0.082-0.158-0.179-0.189-0.153-0.046-0.301-0.092-0.454-0.138-0.158-0.051-0.25-0.025-0.357 0.107-0.194 0.245-0.388 0.485-0.582 0.73-1.051 1.316-2.102 2.638-3.158 3.954-0.020 0.020-0.041 0.046-0.071 0.082zM7.987 13.276c0-0.010-0.005-0.025-0.005-0.036-0.031-0.189-0.056-0.372-0.087-0.561-0.138-0.883-0.327-1.75-0.571-2.612-0.281-0.985-0.643-1.944-1.133-2.847-0.020-0.036-0.041-0.071-0.061-0.107-0.087-0.143-0.311-0.143-0.408-0.015-0.025 0.036-0.056 0.066-0.082 0.102-0.367 0.469-0.699 0.969-1.020 1.475-0.694 1.102-1.337 2.24-1.949 3.393-0.23 0.429-0.449 0.862-0.673 1.296-0.066 0.127-0.061 0.24 0.020 0.362 0.173 0.25 0.367 0.48 0.592 0.679 0.459 0.413 0.985 0.725 1.551 0.959 0.551 0.23 1.128 0.372 1.709 0.49 0.168 0.036 0.281-0.015 0.383-0.153 0.286-0.393 0.577-0.775 0.867-1.163 0.26-0.347 0.52-0.699 0.786-1.046 0.051-0.066 0.077-0.133 0.082-0.214zM26.054 15.868c0.015 0 0.036-0.005 0.056-0.010 0.316-0.071 0.633-0.133 0.944-0.219 0.704-0.194 1.367-0.48 1.964-0.913 0.383-0.275 0.719-0.602 0.99-0.995 0.087-0.127 0.097-0.245 0.025-0.388-0.663-1.306-1.367-2.597-2.117-3.857-0.413-0.699-0.847-1.383-1.327-2.036-0.087-0.117-0.179-0.235-0.27-0.352-0.112-0.143-0.327-0.133-0.418 0.020-0.025 0.036-0.046 0.077-0.066 0.112-0.311 0.582-0.577 1.184-0.796 1.806-0.474 1.347-0.77 2.735-0.974 4.143-0.020 0.122 0.010 0.225 0.082 0.321 0.342 0.449 0.679 0.903 1.015 1.352 0.219 0.291 0.439 0.582 0.658 0.877 0.056 0.087 0.133 0.133 0.235 0.138zM16.018 0.837c-0.393 0.010-0.786 0.031-1.173 0.066-0.418 0.041-0.837 0.117-1.245 0.23-0.23 0.061-0.449 0.138-0.663 0.245-0.148 0.077-0.199 0.179-0.168 0.332 0.112 0.531 0.245 1.061 0.423 1.571 0.194 0.541 0.423 1.066 0.75 1.546 0.25 0.372 0.546 0.704 0.923 0.954 0.311 0.204 0.653 0.306 1.015 0.342 0.275 0.025 0.546-0.025 0.806-0.112 0.408-0.138 0.74-0.388 1.025-0.704 0.367-0.403 0.633-0.862 0.857-1.357 0.321-0.714 0.531-1.464 0.689-2.23 0.031-0.158-0.005-0.25-0.148-0.327-0.102-0.051-0.204-0.102-0.311-0.143-0.561-0.209-1.143-0.311-1.74-0.362-0.347-0.025-0.694-0.036-1.041-0.051zM20.125 2.669c-0.122 0-0.209 0.061-0.245 0.184-0.128 0.429-0.27 0.852-0.444 1.26-0.306 0.714-0.684 1.383-1.24 1.934-0.112 0.112-0.117 0.265-0.010 0.398 0.699 0.872 1.393 1.745 2.087 2.612 0.020 0.025 0.041 0.051 0.066 0.077 0.153 0.138 0.383 0.056 0.413-0.138 0.010-0.046 0.015-0.092 0.025-0.138 0.036-0.265 0.071-0.536 0.112-0.801 0.051-0.372 0.102-0.745 0.153-1.112 0.056-0.418 0.112-0.837 0.168-1.255 0.061-0.459 0.128-0.923 0.189-1.383 0.010-0.077-0.005-0.148-0.051-0.209-0.036-0.051-0.077-0.102-0.117-0.153-0.296-0.383-0.592-0.765-0.883-1.148-0.061-0.077-0.128-0.122-0.225-0.127zM10.63 4.286c0.015 0.128 0.031 0.255 0.051 0.378 0.056 0.418 0.117 0.837 0.173 1.255 0.056 0.423 0.112 0.842 0.173 1.265 0.066 0.48 0.133 0.959 0.199 1.434 0.020 0.133 0.036 0.27 0.061 0.398 0.025 0.133 0.163 0.204 0.296 0.179 0.087-0.015 0.133-0.071 0.184-0.133 0.408-0.51 0.816-1.025 1.224-1.536 0.286-0.357 0.571-0.714 0.852-1.071 0.122-0.153 0.122-0.281-0.005-0.408-0.403-0.408-0.719-0.877-0.98-1.383-0.296-0.571-0.52-1.173-0.699-1.791-0.031-0.102-0.082-0.173-0.194-0.199s-0.199 0.010-0.265 0.102c-0.337 0.439-0.673 0.872-1.010 1.311-0.046 0.056-0.061 0.122-0.061 0.199zM18.727 14.878c-0.265 0-0.485 0.214-0.485 0.48s0.214 0.485 0.48 0.485c0.27 0 0.495-0.24 0.48-0.475 0.020-0.245-0.204-0.49-0.474-0.49zM18.237 19.75c0 0.265 0.25 0.48 0.474 0.48 0.25 0.005 0.485-0.23 0.49-0.48 0-0.276-0.26-0.505-0.48-0.48-0.245-0.020-0.485 0.23-0.485 0.48zM18.727 23.658c-0.26 0-0.474 0.214-0.485 0.469-0.010 0.225 0.184 0.495 0.485 0.495s0.495-0.265 0.474-0.474c0.020-0.27-0.235-0.49-0.474-0.49zM11.146 15.077c-0.015 0.194-0.010 0.755 0.010 0.826 0.225 0.020 2.403 0.010 2.474-0.010 0-0.27 0-0.546 0-0.821-0.199-0.031-2.413-0.020-2.485 0.005z"></path>
</svg>';
break;
default:
return '';
}
}
/*
=============================================================================
* Get Theme Font Icon
* ============================================================================= */
if ( ! function_exists( 'laundry_get_theme_font' ) ) {
function laundry_get_theme_font() {
if ( isset( $GLOBALS['laundry_theme_icons'] ) && is_array( $GLOBALS['laundry_theme_icons'] ) ) {
return $GLOBALS['laundry_theme_icons'];
}
$GLOBALS['laundry_theme_icons'] = apply_filters(
'laundry_theme_icons',
array(
array( 'icon-email' => 'icon-email' ),
array( 'icon-fax-machine' => 'icon-fax-machine' ),
array( 'icon-iron' => 'icon-iron' ),
array( 'icon-ironing-board' => 'icon-ironing-board' ),
array( 'icon-sewing-machine' => 'icon-sewing-machine' ),
array( 'icon-shoes' => 'icon-shoes' ),
array( 'icon-bright-lightbulb' => 'icon-bright-lightbulb' ),
array( 'icon-tag-1' => 'icon-tag-1' ),
array( 'icon-reading-book' => 'icon-reading-book' ),
array( 'icon-quality' => 'icon-quality' ),
array( 'icon-express-delivery' => 'icon-express-delivery' ),
array( 'icon-interface' => 'icon-interface' ),
array( 'icon-telephone' => 'icon-telephone' ),
array( 'icon-clock' => 'icon-clock' ),
array( 'icon-map-pointer' => 'icon-map-pointer' ),
array( 'icon-people' => 'icon-people' ),
array( 'icon-play' => 'icon-play' ),
array( 'icon-search' => 'icon-search' ),
array( 'icon-shirt' => 'icon-shirt' ),
array( 'icon-bag' => 'icon-bag' ),
array( 'icon-towel' => 'icon-towel' ),
array( 'icon-star' => 'icon-star' ),
array( 'icon-tag' => 'icon-tag' ),
array( 'icon-electric-iron' => 'icon-electric-iron' ),
array( 'icon-technology' => 'icon-technology' ),
array( 'icon-Laundry-detergent-free-icon-4' => 'icon-Laundry-detergent-free-icon-4' ),
array( 'icon-video' => 'icon-video' ),
array( 'icon-arrows' => 'icon-arrows' ),
array( 'icon-basic-tick' => 'icon-basic-tick' ),
array( 'icon-bag1' => 'icon-bag1' ),
array( 'icon-delivery-truck' => 'icon-delivery-truck' ),
array( 'icon-tool' => 'icon-tool' ),
array( 'icon-clothes-1' => 'icon-clothes-1' ),
array( 'icon-clothes-2' => 'icon-clothes-2' ),
array( 'icon-clothes-3' => 'icon-clothes-3' ),
array( 'icon-clothes-4' => 'icon-clothes-4' ),
array( 'icon-hand-wash' => 'icon-hand-wash' ),
array( 'icon-hanger' => 'icon-hanger' ),
array( 'icon-laundry' => 'icon-laundry' ),
array( 'icon-instagram-social-network-logo-of-photo-camera' => 'icon-instagram-social-network-logo-of-photo-camera' ),
array( 'icon-linkedin-logo' => 'icon-linkedin-logo' ),
array( 'icon-twitter-logo-silhouette' => 'icon-twitter-logo-silhouette' ),
array( 'icon-facebook-logo' => 'icon-facebook-logo' ),
array( 'icon-social' => 'icon-social' ),
array( 'icon-social-1' => 'icon-social-1' ),
array( 'icon-vimeo' => 'icon-vimeo' ),
array( 'icon-left-arrow' => 'icon-left-arrow' ),
array( 'icon-right-arrow' => 'icon-right-arrow' ),
array( 'icon-pilesos' => 'icon-pilesos' ),
array( 'icon-hanger-with-clothes' => 'icon-hanger-with-clothes' ),
array( 'icon-menu-button-of-three-horizontal-lines' => 'icon-menu-button-of-three-horizontal-lines' ),
array( 'icon-cancel-music' => 'icon-cancel-music' ),
array( 'icon-customers' => 'icon-customers' ),
array( 'icon-exit' => 'icon-exit' ),
array( 'icon-university-campus' => 'icon-university-campus' ),
array( 'icon-building' => 'icon-building' ),
array( 'icon-towel2' => 'icon-towel2' ),
array( 'icon-garbage' => 'icon-garbage' ),
array( 'icon-furniture' => 'icon-furniture' ),
array( 'icon-chat-bubble' => 'icon-chat-bubble' ),
array( 'icon-today' => 'icon-today' ),
array( 'icon-angle-down' => 'icon-angle-down' ),
array( 'icon-angle-up' => 'icon-angle-up' ),
array( 'icon-bin' => 'icon-bin' ),
array( 'icon-calendar' => 'icon-calendar' ),
array( 'icon-arrow' => 'icon-arrow' ),
array( 'icon-arrow.opened' => 'icon-arrow.opened' ),
)
);
return $GLOBALS['laundry_theme_icons'];
}
}
/*
=============================================================================
* Get Theme Font Icon
* ============================================================================= */
if ( ! function_exists( 'laundry_get_theme_font' ) ) {
function laundry_get_theme_font() {
if ( function_exists( 'laundry_get_theme_font' ) ) {
return laundry_get_theme_font();
}
$fonts = array();
return $fonts;
}
}
/*
=============================================================================
* Add theme icon
* ============================================================================= */
if ( ! function_exists( 'laundry_add_theme_icon' ) ) {
function laundry_add_theme_icon( $icons ) {
$icons['Laundry Icon'] = &laundry_get_theme_font();
return $icons;
}
add_filter( 'vc_iconpicker-type-fontawesome', 'laundry_add_theme_icon' );
}
/**
* return redux options
*/
if ( ! function_exists( 'laundry_get_options' ) ) {
function laundry_get_options() {
global $laundry_opt;
return $laundry_opt;
}
}
function laundry_services_options() {
global $laundry_opt;
return $laundry_opt;
}
/**
* is_blog compatibility.
*/
function is_blog() {
if ( ( is_archive() ) || ( is_author() ) || ( is_category() ) || ( is_home() ) || ( is_single() ) || ( is_tag() ) ) {
return true;
} else {
return false;
}
}
/**
* Breadcrumb
*/
add_action( 'laundry_breadcrumb', 'laundry_breadcrumb' );
function laundry_breadcrumb() {
global $post;
$laundry_option = laundry_services_options();
$theme = $laundry_option['laundry_demo_select'];
if ( ! isset( $post->ID ) ) {
return false;
}
if ( ! is_front_page() || is_home() ) {
if ( ( isset( $post->post_type ) && is_page() ) || is_search() || is_home() || is_single() || is_archive() || is_category() ) {
$show_breadcrumb = get_post_meta( $post->ID, 'framework_show_breadcrumb', true );
if ( is_search() || is_home() || is_single() || is_archive() || is_category() ) {
if ( isset( $laundry_option['laundry-blog-show-breadcrumb'] ) && $laundry_option['laundry-blog-show-breadcrumb']
) {
$show_breadcrumb = 'on';
} elseif ( isset( $laundry_option['laundry-service-show-breadcrumb'] ) && $laundry_option['laundry-service-show-breadcrumb']
) {
} else {
$show_breadcrumb = 'off';
}
}
if ( $show_breadcrumb == 'on' || ! $show_breadcrumb ) {
if ( function_exists( 'yoast_breadcrumb' ) ) {
if ( $theme == '2' ) {
if ( is_blog() ) {
$header_bg = $laundry_option['laundry-header-breadcamb']['url'];
} else {
$header_bg = get_the_post_thumbnail_url();
}
?>
<div id="subtitle-wrapper" class="lazyload" data-bg="<?php echo esc_url( $header_bg ); ?>">
<div class="container container-fluid-xl">
<div class="tt-breadcrumbs">
<?php
if ( is_single() && ! is_singular( 'laundry_services' ) ) {
?>
<span><span><a href="<?php echo home_url(); ?>"><?php esc_html_e( 'Home', 'laundry' ); ?></a> / <span class="breadcrumb_last" aria-current="page"><?php esc_html_e( 'Single Post', 'laundry' ); ?></span></span></span>
<?php
} else {
yoast_breadcrumb( '', '' );
}
?>
</div>
<h1 class="subtitle__title">
<?php
if ( is_archive() ) {
get_the_archive_title();
} elseif ( is_search() ) {
if ( have_posts() ) :
printf( esc_html__( 'Search Results for: %s', 'laundry' ), '<span>' . get_search_query() . '</span>' );
else :
esc_html_e( 'Nothing Found', 'laundry' );
endif;
} elseif ( is_404() ) {
esc_html_e( 'Error Page', 'laundry' );
} elseif ( is_blog() ) {
if ( is_single() ) {
if ( is_singular( 'laundry_services' ) ) {
the_title();
} elseif ( is_singular( 'product' ) ) {
esc_html_e( 'Single Product', 'laundry' );
} else {
esc_html_e( 'Single Post', 'laundry' );
}
} else {
esc_html_e( 'Blog Posts', 'laundry' );
}
} else {
the_title();
}
?>
</h1>
</div>
<div class="bubbleContainer">
<div class="bubble-1"></div>
<div class="bubble-2"></div>
<div class="bubble-3"></div>
<div class="bubble-4"></div>
<div class="bubble-5"></div>
<div class="bubble-6"></div>
<div class="bubble-7"></div>
<div class="bubble-8"></div>
<div class="bubble-9"></div>
<div class="bubble-10"></div>
</div>
</div>
<?php
} else {
?>
<div class="breadcrumb">
<div class="container">
<div class="row">
<div class="breadcrumbs">
<div class="container">
<div class="row">
<?php
yoast_breadcrumb( '', '' );
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
}
}
}
}
function laundry_services_coupon_popup_ajax() {
check_ajax_referer( 'coupon', 'security' );
$post_id = $_POST['post_id'];
$coupon_address = get_post_meta( $post_id, 'framework-coupon-address', true );
$coupon_date = get_post_meta( $post_id, 'framework-coupon-date', true );
$coupon_offer_title = get_post_meta( $post_id, 'framework-coupon-offer-title', true );
$coupon_offer_subtitle = get_post_meta( $post_id, 'framework-coupon-offer-subtitle', true );
$coupon_bottom_right = get_post_meta( $post_id, 'framework-coupon-bottom-right', true );
$coupon_color_style = get_post_meta( $post_id, 'framework-coupon-color-style', true );
if ( $coupon_color_style == 'coupon_green' ) {
$coupon_color_style = 'style1';
} elseif ( $coupon_color_style == 'coupon_blue' ) {
$coupon_color_style = 'style2';
} elseif ( $coupon_color_style == 'coupon_black' ) {
$coupon_color_style = 'style3';
}
?>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"><?php echo esc_html__( 'Coupon', 'laundry' ); ?></h4>
</div>
<div class="modal-body" id="modal-coupon">
<div>
<div class="coupon <?php echo sprintf( __( '%s', 'laundry' ), $coupon_color_style ); ?>">
<div class="inside">
<div class="coupon-logo"><?php echo get_the_post_thumbnail( $post_id, 'laundry_services-coupon' ); ?></div>
<div class="text1"><?php echo sprintf( __( '%s', 'laundry' ), $coupon_address ); ?></div>
<div class="text2"><?php echo sprintf( __( '%s', 'laundry' ), $coupon_date ); ?></div>
<div class="text3"><?php echo sprintf( __( '%s', 'laundry' ), $coupon_offer_title ); ?></div>
<div class="text4"><?php echo sprintf( __( '%s', 'laundry' ), $coupon_offer_subtitle ); ?></div>
<div class="text5"><?php echo sprintf( __( '%s', 'laundry' ), $coupon_bottom_right ); ?></div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" id="btn_save_close" class="btn btn-default btn-blue" data-dismiss="modal"><?php echo esc_html__( 'Close', 'laundry' ); ?></button>
<button id="btn_save_and_close" type="button" class="btn btn-default btn-blue"><?php echo esc_html__( 'Print', 'laundry' ); ?> </button>
</div>
</div>
</div>
</div>
<?php
exit();
}
add_action( 'wp_ajax_coupon_popup_ajax', 'laundry_services_coupon_popup_ajax' );
add_action( 'wp_ajax_nopriv_coupon_popup_ajax', 'laundry_services_coupon_popup_ajax' );
if ( ! function_exists( 'laundry_services_post_class' ) ) {
function laundry_services_post_class( $classes ) {
global $post;
if ( isset( $post->post_type ) && $post->post_type == 'post' ) {
if ( is_single( $post ) ) {
$classes[] = 'blog-post';
$classes[] = 'single';
}
}
return $classes;
}
}
add_filter( 'post_class', 'laundry_services_post_class' );
function laundry_elementor_library() {
$pageslist = get_posts(
array(
'post_type' => 'elementor_library',
'posts_per_page' => -1,
)
);
$pagearray = array();
if ( ! empty( $pageslist ) ) {
foreach ( $pageslist as $page ) {
$pagearray[ $page->ID ] = $page->post_title;
}
}
return $pagearray;
}