public function saveCustomField($post_id) { if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } if (isset($_POST['_inline_edit'])) { return $post_id; } if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'list') { return $post_id; } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'trash') { return $post_id; } // Save featured for post if (isset($_POST['featured_post'])) { update_post_meta($post_id, THEME_SLUG . 'featured_post', $_POST['featured_post']); } // Save layout for custom page if (isset($_POST['custom_page_layout'])) { update_post_meta($post_id, THEME_SLUG . 'custom_page_layout', $_POST['custom_page_layout']); } // Save product custom layout & sidebar if (isset($_POST['custom_product_layout']) && $_POST['custom_product_layout'] == "custom_single_prod_layout") { $_default_prod_config = array('layout' => $_POST['single_layout'], 'left_sidebar' => $_POST['single_left_sidebar'], 'right_sidebar' => $_POST['single_right_sidebar']); $ret_str = serialize($_default_prod_config); update_post_meta($post_id, THEME_SLUG . 'custom_product_config', $ret_str); } if (isset($_POST['custom_sidebar'])) { update_post_meta($post_id, THEME_SLUG . 'custom_sidebar', $_POST['custom_sidebar']); } if (isset($_POST['username_twitter_testimonial'])) { update_post_meta($post_id, THEME_SLUG . 'username_twitter_testimonial', $_POST['username_twitter_testimonial']); } // Save Gallery for slideshow if (isset($_POST['gal_slideshow'])) { update_post_meta($post_id, THEME_SLUG . 'gal_slideshow', $_POST['gal_slideshow']); } // Save select for ew_slideshow if (isset($_POST['slideshow_post'])) { update_post_meta($post_id, THEME_SLUG . 'slideshow_post', $_POST['slideshow_post']); } // Save select for video // Save logo icon for service if (isset($_POST['ew_service_custom_logo'])) { update_post_meta($post_id, THEME_SLUG . 'ew_service_custom_logo', $_POST['ew_service_custom_logo']); } if (isset($_POST['_page_config']) && (int) $_POST['_page_config'] == 1 && wp_verify_nonce($_POST['nonce_page_config'], '_update_page_config')) { $_post_params = array("page_layout" => $_POST['page_layout'], "main_content_layout" => $_POST['main_content_layout'], "header_layout" => $_POST['header_layout'], "footer_layout" => $_POST['footer_layout'], "main_slider_layout" => $_POST['main_slider_layout'], "banner_layout" => $_POST['banner_layout'], "page_column" => $_POST['page_column'], "left_sidebar" => $_POST['left_sidebar'], "right_sidebar" => $_POST['right_sidebar'], "page_slider" => $_POST['page_slider'], "page_revolution" => $_POST['page_revolution'], "page_flex" => $_POST['page_flex'], "page_nivo" => $_POST['page_nivo'], "product_tag" => $_POST['product_tag'], "portfolio_columns" => absint($_POST['portfolio_columns']), "portfolio_filter" => absint($_POST['portfolio_filter']), "toggle_vertical_menu" => absint($_POST['toggle_vertical_menu']), "hide_breadcrumb" => absint($_POST['hide_breadcrumb']), "hide_title" => absint($_POST['hide_title']), "hide_ads" => absint($_POST['hide_ads']), "hide_slider_hot_product" => absint($_POST['hide_slider_hot_product'])); //die(print_r($_post_params)); $_post_params = wd_array_atts(array("page_layout" => '0', "main_content_layout" => 'box', "header_layout" => 'box', "footer_layout" => 'box', "main_slider_layout" => 'box', "banner_layout" => 'box', "page_column" => '0-1-0', "left_sidebar" => 'primary-widget-area', "right_sidebar" => 'primary-widget-area', "page_slider" => 'none', "page_revolution" => '', "page_flex" => '', "page_nivo" => '', "product_tag" => '', "portfolio_columns" => 1, "portfolio_filter" => 1, "toggle_vertical_menu" => 1, "hide_breadcrumb" => 0, "hide_title" => 0, "hide_slider_hot_product" => 1), $_post_params); $ret_str = serialize($_post_params); update_post_meta($post_id, THEME_SLUG . 'page_configuration', $ret_str); } }
function wd_array_atts($pairs, $atts) { $atts = (array) $atts; $out = array(); foreach ($pairs as $name => $default) { if (array_key_exists($name, $atts)) { if (is_array($atts[$name])) { $out[$name] = wd_array_atts($default, $atts[$name]); } else { if (strlen(trim($atts[$name])) > 0) { $out[$name] = $atts[$name]; } else { $out[$name] = $default; } } } else { $out[$name] = $default; } } return $out; }
function wd_of_option_setup() { global $of_options, $options_machine; $wd_data = of_get_options(); $options_machine = new Options_Machine($of_options); $wd_data = wd_array_atts($options_machine->Defaults, $wd_data); wd_of_save_options($wd_data); }
<?php global $default_custom_style_config; $custom_style_config = get_option(THEME_SLUG . 'custom_style_config', ''); $custom_style_config_arr = unserialize($custom_style_config); $custom_style_config_arr = wd_array_atts($default_custom_style_config, $custom_style_config_arr); $enable_custom_preview = (int) $custom_style_config_arr['enable_custom_preview']; $enable_custom_font = (int) $custom_style_config_arr['enable_custom_font']; $enable_custom_color = (int) $custom_style_config_arr['enable_custom_color']; /***************Start font block****************/ $api_key = get_option(THEME_SLUG . 'googlefont_api_key', 'AIzaSyAP4SsyBZEIrh0kc_cO9s90__r2oCJ8Rds'); $google_font_url = "https://www.googleapis.com/webfonts/v1/webfonts?key=" . $api_key; $body_font_name = $custom_style_config_arr['body_font_name']; $body_font_style = $custom_style_config_arr['body_font_style']; $body_font_style_str = $custom_style_config_arr['body_font_style_str']; //$body_font_size = $custom_style_config_arr['body_font_size']; $body_font_weight = $custom_style_config_arr['body_font_weight']; $heading_font_name = $custom_style_config_arr['heading_font_name']; $heading_font_style = $custom_style_config_arr['heading_font_style']; $heading_font_style_str = $custom_style_config_arr['heading_font_style_str']; //$heading_font_size = $custom_style_config_arr['heading_font_size']; $heading_font_weight = $custom_style_config_arr['heading_font_weight']; $menu_font_name = $custom_style_config_arr['menu_font_name']; $menu_font_style = $custom_style_config_arr['menu_font_style']; $menu_font_style_str = $custom_style_config_arr['menu_font_style_str']; //$menu_font_size = $custom_style_config_arr['menu_font_size']; $menu_font_weight = $custom_style_config_arr['menu_font_weight']; $sub_menu_font_name = $custom_style_config_arr['sub_menu_font_name']; $sub_menu_font_style = $custom_style_config_arr['sub_menu_font_style']; $sub_menu_font_style_str = $custom_style_config_arr['sub_menu_font_style_str']; //$menu_font_size = $custom_style_config_arr['menu_font_size'];
<?php global $post; $revolution_exists = class_exists('RevSlider') && class_exists('UniteFunctionsRev'); $layerslider_exists = class_exists('LS_Sliders'); $datas = unserialize(get_post_meta($post->ID, THEME_SLUG . 'page_configuration', true)); $datas = wd_array_atts(array("page_layout" => '0', "page_column" => '0-1-0', "left_sidebar" => 'primary-widget-area', "right_sidebar" => 'primary-widget-area', "page_slider" => 'none', "page_revolution" => '', "page_layerslider" => '', "hide_breadcrumb" => 0, "hide_title" => 0, "hide_top_content_widget_area" => 1), $datas); ?> <div class="page_config_wrapper"> <div class="page_config_wrapper_inner"> <input type="hidden" value="1" name="_page_config"> <?php wp_nonce_field("_update_page_config", "nonce_page_config"); ?> <ul class="page_config_list"> <li class="first"> <p> <label><?php _e('Layout Style', 'wpdance'); ?> </label> <select name="page_layout" id="page_layout"> <option value="0" <?php if (strcmp($datas['page_layout'], '0') == 0) { echo "selected"; } ?> >Inherit</option> <option value="wide" <?php if (strcmp($datas['page_layout'], 'wide') == 0) { echo "selected";
<?php $archive_page_config = get_option(THEME_SLUG . 'archive_page_config', ''); $archive_page_config = unserialize($archive_page_config); $archive_page_config = wd_array_atts(array('show_category' => 1, 'show_author_post_link' => 1, 'show_time' => 1, 'show_tags' => 1, 'show_views_count' => 1, 'show_comment_count' => 1, 'show_excerpt' => 1, 'show_thumb' => 1, 'show_read_more' => 1, 'show_category_phone' => 1, 'show_author_post_link_phone' => 1, 'show_time_phone' => 1, 'show_tags_phone' => 1, 'show_views_count_phone' => 1, 'show_comment_count_phone' => 1, 'show_excerpt_phone' => 1, 'show_thumb_phone' => 1, 'show_read_more_phone' => 1), $archive_page_config); ?> <div id="tab-listing-page" class="custompost-tab"> <div class="tab-title"> <h2><span><?php _e('Custom archive page', 'wpdance'); ?> </span></h2> </div><!-- .tab-title --> <div class="tab-content"> <form name="config-archive-page" method="POST" action="<?php echo admin_url('admin-ajax.php'); ?> " enctype="multipart/form-data" id="config-archive-page"> <input type="hidden" value="1" name="config_archive_page"/> <div class="code-head area-config area-config1"> <div class="area-inner"> <div class="area-inner1"> <h3 class="area-title"><?php _e('Config archive page', 'wpdance'); ?> </h3> <?php $this->showTooltip(__("Config archive page", 'wpdance'), __("Config archive page", 'wpdance')); ?> <div class="area-content"> <p>
public function saveCustomField($post_id) { if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } if (isset($_POST['_inline_edit'])) { return $post_id; } if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'list') { return $post_id; } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'trash') { return $post_id; } // Save featured for post if (isset($_POST['featured_post'])) { update_post_meta($post_id, THEME_SLUG . 'featured_post', $_POST['featured_post']); } if (isset($_POST['showbreakingnews'])) { update_post_meta($post_id, THEME_SLUG . 'showbreakingnews', 1); } else { update_post_meta($post_id, THEME_SLUG . 'showbreakingnews', 0); } // Save layout for custom page if (isset($_POST['custom_page_layout'])) { update_post_meta($post_id, THEME_SLUG . 'custom_page_layout', $_POST['custom_page_layout']); } // Save product custom layout & sidebar if (isset($_POST['custom_product_layout']) && $_POST['custom_product_layout'] == "custom_single_prod_layout") { $_default_prod_config = array('layout' => $_POST['single_layout'], 'left_sidebar' => $_POST['single_left_sidebar'], 'right_sidebar' => $_POST['single_right_sidebar']); $ret_str = serialize($_default_prod_config); update_post_meta($post_id, THEME_SLUG . 'custom_product_config', $ret_str); } // Save post custom layout & sidebar if (isset($_POST['custom_post_layout']) && $_POST['custom_post_layout'] == "custom_single_post_layout") { $_default_post_config = array('video' => esc_url($_POST['single_video']), 'layout' => $_POST['single_layout'], 'left_sidebar' => $_POST['single_left_sidebar'], 'right_sidebar' => $_POST['single_right_sidebar']); $ret_str = serialize($_default_post_config); update_post_meta($post_id, THEME_SLUG . 'custom_post_config', $ret_str); } //Save product ADS Sidebar if (isset($_POST['wd_ads_position']) && isset($_POST['wd_ads_content']) && isset($_POST['wd_ads_name'])) { $wd_ads_name = $_POST['wd_ads_name']; $wd_ads_position = $_POST['wd_ads_position']; $wd_ads_content = $_POST['wd_ads_content']; $wd_ads_count = sizeof($wd_ads_name); // Save Attributes $wd_ads_sidebar = array(); if ($wd_ads_count > 0) { for ($i = 0; $i < $wd_ads_count; $i++) { //if ( ! $wd_ads_name[ $i ] ) // continue; $wd_ads_sidebar[sanitize_title($wd_ads_name[$i] . rand())] = array('name' => sanitize_text_field($wd_ads_name[$i]), 'position' => $wd_ads_position[$i], 'content' => $wd_ads_content[$i]); } update_post_meta($post_id, THEME_SLUG . 'product_ads_sidebar', $wd_ads_sidebar); } } else { delete_post_meta($post_id, THEME_SLUG . 'product_ads_sidebar'); } if (isset($_POST['custom_sidebar'])) { update_post_meta($post_id, THEME_SLUG . 'custom_sidebar', $_POST['custom_sidebar']); } if (isset($_POST['username_twitter_testimonial'])) { update_post_meta($post_id, THEME_SLUG . 'username_twitter_testimonial', $_POST['username_twitter_testimonial']); } // Save Gallery for slideshow if (isset($_POST['gal_slideshow'])) { update_post_meta($post_id, THEME_SLUG . 'gal_slideshow', $_POST['gal_slideshow']); } // Save select for ew_slideshow if (isset($_POST['slideshow_post'])) { update_post_meta($post_id, THEME_SLUG . 'slideshow_post', $_POST['slideshow_post']); } // Save select for video // Save logo icon for service if (isset($_POST['ew_service_custom_logo'])) { update_post_meta($post_id, THEME_SLUG . 'ew_service_custom_logo', $_POST['ew_service_custom_logo']); } if (isset($_POST['_page_config']) && (int) $_POST['_page_config'] == 1 && wp_verify_nonce($_POST['nonce_page_config'], '_update_page_config')) { $_post_params = array("page_layout" => $_POST['page_layout'], "page_column" => $_POST['page_column'], "left_sidebar" => $_POST['left_sidebar'], "right_sidebar" => $_POST['right_sidebar'], "page_slider" => $_POST['page_slider'], "page_revolution" => isset($_POST['page_revolution']) ? $_POST['page_revolution'] : '', "page_layerslider" => isset($_POST['page_layerslider']) ? $_POST['page_layerslider'] : '', "hide_breadcrumb" => absint($_POST['hide_breadcrumb']), "hide_title" => absint($_POST['hide_title']), "hide_top_content_widget_area" => absint($_POST['hide_top_content_widget_area'])); $_post_params = wd_array_atts(array("page_layout" => '0', "page_column" => '0-1-0', "left_sidebar" => 'primary-widget-area', "right_sidebar" => 'primary-widget-area', "page_slider" => 'none', "page_revolution" => '', "page_layerslider" => '', "hide_breadcrumb" => 0, "hide_title" => 0, "hide_top_content_widget_area" => 1), $_post_params); $ret_str = serialize($_post_params); update_post_meta($post_id, THEME_SLUG . 'page_configuration', $ret_str); } }
function wd_edit_category_fields($term, $taxonomy) { $datas = get_metadata('woocommerce_term', $term->term_id, "cat_config", true); if (strlen($datas) > 0) { $datas = unserialize($datas); } else { $datas = get_option(THEME_SLUG . 'category_product_config', ''); $datas = unserialize($datas); $datas = wd_array_atts(array('cat_columns' => 0, 'cat_layout' => "0", 'cat_left_sidebar' => "0", 'cat_right_sidebar' => "0", 'cat_custom_content' => ''), $datas); } ?> <tr class="form-field"> <th scope="row" valign="top"><label><?php _e('Product Columns', 'wpdance'); ?> </label></th> <td> <select name="cat_columns" id="_prod_cat_columns" class="postform"> <option value="0" <?php if (strcmp($datas["cat_columns"], '0') == 0) { echo "selected='selected'"; } ?> > Default </option> <option value="2" <?php if (strcmp($datas["cat_columns"], '2') == 0) { echo "selected='selected'"; } ?> > 2 Columns </option> <option value="3" <?php if (strcmp($datas["cat_columns"], '3') == 0) { echo "selected='selected'"; } ?> > 3 Columns </option> <option value="4" <?php if (strcmp($datas["cat_columns"], '4') == 0) { echo "selected='selected'"; } ?> > 4 Columns </option> <option value="6" <?php if (strcmp($datas["cat_columns"], '6') == 0) { echo "selected='selected'"; } ?> > 6 Columns </option> </select> </td> </tr> <tr class="form-field"> <th scope="row" valign="top"><label><?php _e('Category Layout', 'wpdance'); ?> </label></th> <td> <select name="cat_layout" id="_prod_cat_layout" class="postform"> <option value="0" <?php if (strcmp($datas["cat_layout"], '0') == 0) { echo "selected='selected'"; } ?> > Default </option> <option value="0-1-0" <?php if (strcmp($datas["cat_layout"], '0-1-0') == 0) { echo "selected='selected'"; } ?> > Fullwidth </option> <option value="0-1-1" <?php if (strcmp($datas["cat_layout"], '0-1-1') == 0) { echo "selected='selected'"; } ?> > Right Sidebar </option> <option value="1-1-0" <?php if (strcmp($datas["cat_layout"], '1-1-0') == 0) { echo "selected='selected'"; } ?> > Left Sidebar </option> <option value="1-1-1" <?php if (strcmp($datas["cat_layout"], '1-1-1') == 0) { echo "selected='selected'"; } ?> > Left & Right Sidebar </option> </select> </td> </tr> <tr class="form-field"> <th scope="row" valign="top"><label><?php _e('Left SideBar', 'wpdance'); ?> </label></th> <td> <select name="cat_left_sidebar" id="_prod_cat_left_sidebar" class="postform"> <option value="0" <?php if (strcmp($datas["cat_left_sidebar"], '0') == 0) { echo "selected='selected'"; } ?> > Default </option> <?php global $default_sidebars; foreach ($default_sidebars as $key => $_sidebar) { $_selected_str = strcmp($datas["cat_left_sidebar"], $_sidebar['id']) == 0 ? "selected='selected'" : ""; echo "<option value='{$_sidebar['id']}' {$_selected_str}>{$_sidebar['name']}</option>"; } ?> </select> </td> </tr> <tr class="form-field"> <th scope="row" valign="top"><label><?php _e('Right Sidebar', 'wpdance'); ?> </label></th> <td> <select name="cat_right_sidebar" id="_prod_cat_right_sidebar" class="postform"> <option value="0" <?php if (strcmp($datas["cat_right_sidebar"], '0') == 0) { echo "selected='selected'"; } ?> > Default </option> <?php global $default_sidebars; foreach ($default_sidebars as $key => $_sidebar) { $_selected_str = strcmp($datas["cat_right_sidebar"], $_sidebar['id']) == 0 ? "selected='selected'" : ""; echo "<option value='{$_sidebar['id']}' {$_selected_str}>{$_sidebar['name']}</option>"; } ?> </select> </td> </tr> <tr class="form-field"> <th scope="row" valign="top"><label><?php _e('Custom Informations', 'wpdance'); ?> </label></th> <td> <?php wp_editor(stripslashes(htmlspecialchars_decode(base64_decode($datas['cat_custom_content']))), 'cat_custom_content'); ?> </td> </tr> <?php }
public function config_archive_page() { $archive_page_config = array('show_category' => isset($_POST['show_category']) ? absint($_POST['show_category']) : 0, 'show_author_post_link' => isset($_POST['show_author_post_link']) ? absint($_POST['show_author_post_link']) : 0, 'show_time' => isset($_POST['show_time']) ? absint($_POST['show_time']) : 0, 'show_tags' => isset($_POST['show_tags']) ? absint($_POST['show_tags']) : 0, 'show_views_count' => isset($_POST['show_views_count']) ? absint($_POST['show_views_count']) : 0, 'show_comment_count' => isset($_POST['show_comment_count']) ? absint($_POST['show_comment_count']) : 0, 'show_excerpt' => isset($_POST['show_excerpt']) ? absint($_POST['show_excerpt']) : 0, 'show_thumb' => isset($_POST['show_thumb']) ? absint($_POST['show_thumb']) : 0, 'show_read_more' => isset($_POST['show_read_more']) ? absint($_POST['show_read_more']) : 0, 'show_category_phone' => isset($_POST['show_category_phone']) ? absint($_POST['show_category_phone']) : 0, 'show_author_post_link_phone' => isset($_POST['show_author_post_link_phone']) ? absint($_POST['show_author_post_link_phone']) : 0, 'show_time_phone' => isset($_POST['show_time_phone']) ? absint($_POST['show_time_phone']) : 0, 'show_tags_phone' => isset($_POST['show_tags_phone']) ? absint($_POST['show_tags_phone']) : 0, 'show_views_count_phone' => isset($_POST['show_views_count_phone']) ? absint($_POST['show_views_count_phone']) : 0, 'show_comment_count_phone' => isset($_POST['show_comment_count_phone']) ? absint($_POST['show_comment_count_phone']) : 0, 'show_excerpt_phone' => isset($_POST['show_excerpt_phone']) ? absint($_POST['show_excerpt_phone']) : 0, 'show_thumb_phone' => isset($_POST['show_thumb_phone']) ? absint($_POST['show_thumb_phone']) : 0, 'show_read_more_phone' => isset($_POST['show_read_more_phone']) ? absint($_POST['show_read_more_phone']) : 0); $archive_page_config = wd_array_atts(array('show_category' => 1, 'show_author_post_link' => 1, 'show_time' => 1, 'show_tags' => 1, 'show_views_count' => 1, 'show_comment_count' => 1, 'show_excerpt' => 1, 'show_thumb' => 1, 'show_content' => 1, 'show_read_more' => 1, 'show_category_phone' => 1, 'show_author_post_link_phone' => 1, 'show_time_phone' => 1, 'show_tags_phone' => 1, 'show_views_count_phone' => 1, 'show_comment_count_phone' => 1, 'show_excerpt_phone' => 1, 'show_thumb_phone' => 1, 'show_content_phone' => 1, 'show_read_more_phone' => 1), $archive_page_config); update_option(THEME_SLUG . 'archive_page_config', serialize($archive_page_config)); }
<?php /* Add custom layout for post, portfolio */ global $post, $single_prod_datas; $single_product_config = get_option(THEME_SLUG . 'single_product_config', ''); $single_product_config = unserialize($single_product_config); $custom_sidebar_str = get_option(THEME_SLUG . 'areas'); if ($custom_sidebar_str) { $custom_sidebar_arr = json_decode($custom_sidebar_str); } else { $custom_sidebar_arr = array(); } $datas = wd_array_atts(array('show_image' => 1, 'show_label' => 1, 'show_title' => 1, 'show_sku' => 1, 'show_review' => 1, 'show_availability' => 1, 'show_add_to_cart' => 1, 'show_price' => 1, 'show_short_desc' => 1, 'show_meta' => 1, 'show_related' => 1, 'related_title' => __("Related Products", "wpdance"), 'show_sharing' => 1, 'sharing_title' => "Share this", 'sharing_intro' => "Love it?Share with your friend", 'sharing_custom_code' => "", 'show_ship_return' => 1, 'ship_return_title' => 'FREE SHIPPING & RETURN', 'ship_return_content' => htmlentities('<a href="#"><img src="http://demo.wpdance.com/imgs/woocommerce/return_shipping.png" alt="free shipping and return" title="free shipping and return"></a><div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry' . "'" . 's standard dummy text ever since the 1500s</div>'), 'show_tabs' => 1, 'show_custom_tab' => 1, 'custom_tab_title' => "Custom Tabs Title", 'custom_tab_content' => "<div>Table content goes here</div>", 'show_upsell' => 1, 'upsell_title' => __("YOU MAY ALSO BE INTERESTED IN THE FOLLOWING PRODUCT(S)", 'wpdance'), 'layout' => '0-1-0', 'left_sidebar' => 'product-widget-area', 'right_sidebar' => 'product-widget-area'), $single_product_config); $_prod_config = get_post_meta($post->ID, THEME_SLUG . 'custom_product_config', true); $_default_prod_config = array('layout' => '0', 'left_sidebar' => '0', 'right_sidebar' => '0'); if (strlen($_prod_config) > 0) { $_prod_config = unserialize($_prod_config); if (is_array($_prod_config) && count($_prod_config) > 0) { $_prod_config['layout'] = isset($_prod_config['layout']) && strlen($_prod_config['layout']) > 0 ? $_prod_config['layout'] : $_default_prod_config['layout']; $_prod_config['left_sidebar'] = isset($_prod_config['left_sidebar']) && strlen($_prod_config['left_sidebar']) > 0 ? $_prod_config['left_sidebar'] : $_default_prod_config['left_sidebar']; $_prod_config['right_sidebar'] = isset($_prod_config['right_sidebar']) && strlen($_prod_config['right_sidebar']) > 0 ? $_prod_config['right_sidebar'] : $_default_prod_config['right_sidebar']; } } else { $_prod_config = $_default_prod_config; } ?> <div class="select-layout area-config area-config1"> <div class="area-inner"> <div class="area-inner1"> <h3 class="area-title"><?php
<?php $single_post_config = get_option(THEME_SLUG . 'single_post_config', ''); $single_post_config = unserialize($single_post_config); $single_post_config = wd_array_atts(array('show_category' => 1, 'show_author_post_link' => 1, 'show_time' => 1, 'show_tags' => 1, 'show_thumb' => 1, 'show_view_count' => 1, 'show_comment_count' => 1, 'show_social' => 1, 'show_author' => 1, 'show_related' => 1, 'related_label' => "Related Posts", 'show_comment_list' => 1, 'comment_list_label' => "Responds", 'num_post_related' => 4, 'show_category_phone' => 1, 'show_author_post_link_phone' => 1, 'show_time_phone' => 1, 'show_tags_phone' => 1, 'show_thumb_phone' => 1, 'show_view_count_phone' => 1, 'show_comment_count_phone' => 1, 'show_social_phone' => 1, 'show_author_phone' => 1, 'show_related_phone' => 1, 'show_comment_list_phone' => 1), $single_post_config); ?> <div id="tab-customforpostsingle" class="custompost-tab"> <div class="tab-title"> <h2><span><?php _e('Custom for post page', 'wpdance'); ?> </span></h2> </div><!-- .tab-title --> <div class="tab-content"> <form name="config-single" method="POST" action="<?php echo admin_url('admin-ajax.php'); ?> " enctype="multipart/form-data" id="config-single"> <div class="code-head area-config area-config1"> <div class="area-inner"> <div class="area-inner1"> <h3 class="area-title"><?php _e('Config post detailed page', 'wpdance'); ?> </h3> <?php $this->showTooltip(__("Config post detailed page", 'wpdance'), __("Config post detailed page", 'wpdance')); ?> <div class="area-content"> <p> <label>Show Categories
<?php global $category_prod_datas; $category_product_config = get_option(THEME_SLUG . 'category_product_config', ''); $category_product_config = unserialize($category_product_config); $datas = wd_array_atts(array('cat_columns' => 2, 'cat_layout' => "1-1-0", 'cat_left_sidebar' => "category-widget-area", 'cat_right_sidebar' => "category-widget-area"), $category_product_config); $category_prod_datas = $datas; ?> <div id="tab-product-category" class="custompost-tab"> <div class="tab-title"> <h2><span><?php _e('Custom for product page', 'wpdance'); ?> </span></h2> </div><!-- .tab-title --> <div class="tab-content"> <form name="config-product-category" method="POST" action="<?php echo admin_url('admin-ajax.php'); ?> " enctype="multipart/form-data" id="config-product-category"> <div class="code-head area-config area-config1"> <div class="area-inner"> <div class="area-inner1"> <h3 class="area-title"><?php _e('Config product category page', 'wpdance'); ?> </h3> <?php $this->showTooltip(__("Config product category page", 'wpdance'), __("Config product category page", 'wpdance')); ?> <div class="area-content">
function my_page_template_redirect() { global $wp_query, $post, $page_datas, $wd_data; $wd_data['wd_layout_style'] = isset($wd_data['wd_layout_styles']) ? $wd_data['wd_layout_styles'] : 'wide'; if ($wp_query->is_page()) { global $page_datas, $wd_custom_style_config, $wd_data; $page_datas = unserialize(get_post_meta($post->ID, THEME_SLUG . 'page_configuration', true)); $page_datas = wd_array_atts(array("page_layout" => '0', "header_layout" => '', "page_column" => '0-1-0', "left_sidebar" => 'primary-widget-area', "right_sidebar" => 'primary-widget-area', "page_slider" => 'none', "page_revolution" => '', "page_layerslider" => '', "product_tag" => '', "hide_breadcrumb" => 0, "hide_title" => 0, "hide_top_content_widget_area" => 1, "page_logo" => ''), $page_datas); $wd_data['wd_layout_style'] = strcmp($page_datas['page_layout'], '0') == 0 ? isset($wd_data['wd_layout_styles']) ? $wd_data['wd_layout_styles'] : 'wide' : $page_datas['page_layout']; if (!empty($page_datas['header_layout'])) { $wd_data['wd_header_layout'] = $page_datas['header_layout']; } if (!empty($page_datas['page_logo'])) { $wd_data['wd_logo'] = $page_datas['page_logo']; } /* Easycart - demo layout */ if (class_exists('ec_cart')) { $storepageid = get_option('ec_option_storepage'); if (function_exists('icl_object_id')) { $storepageid = icl_object_id($storepageid, 'page', true, ICL_LANGUAGE_CODE); } if (is_page($storepageid)) { if (isset($_GET['ec_layout']) && $_GET['ec_layout'] == 'full') { $page_datas['page_column'] = '0-1-0'; } } } } if (is_single()) { global $wd_data, $post; /******************* Start Load Config On Single Post ******************/ $_post_config = get_post_meta($post->ID, THEME_SLUG . 'custom_post_config', true); if (strlen($_post_config) > 0) { $_post_config = unserialize($_post_config); if (is_array($_post_config) && count($_post_config) > 0) { $wd_data['wd_post_layout'] = isset($_post_config['layout']) && strlen($_post_config['layout']) > 0 && strcmp($_post_config["layout"], '0') != 0 ? $_post_config['layout'] : $wd_data['wd_post_layout']; $wd_data['wd_post_left_sidebar'] = isset($_post_config['left_sidebar']) && strlen($_post_config['left_sidebar']) > 0 && strcmp($_post_config["left_sidebar"], '0') != 0 ? $_post_config['left_sidebar'] : $wd_data['wd_post_left_sidebar']; $wd_data['wd_post_right_sidebar'] = isset($_post_config['right_sidebar']) && strlen($_post_config['right_sidebar']) > 0 && strcmp($_post_config["right_sidebar"], '0') != 0 ? $_post_config['right_sidebar'] : $wd_data['wd_post_right_sidebar']; if ((strcmp(trim($_post_config['left_sidebar']), "0") != 0 || strcmp(trim($_post_config['right_sidebar']), "0") != 0) && strcmp($wd_data['wd_prod_layout'], '0-1-0') != 0) { } } } } if (is_tax('product_cat') || is_tax('product_tag') || is_post_type_archive("product")) { global $wp_query, $category_prod_datas; $term = $wp_query->queried_object; if (is_object($term)) { $_term_config = get_metadata('woocommerce_term', $term->term_id, "cat_config", true); if (strlen($_term_config) > 0) { $_term_config = unserialize($_term_config); if (is_array($_term_config) && count($_term_config) > 0) { $wd_data['wd_prod_cat_column'] = isset($_term_config['cat_columns']) && strlen($_term_config['cat_columns']) > 0 && (int) $_term_config['cat_columns'] != 0 ? $_term_config['cat_columns'] : $wd_data['wd_prod_cat_column']; $wd_data['wd_prod_cat_layout'] = isset($_term_config['cat_layout']) && strlen($_term_config['cat_layout']) > 0 && strcmp($_term_config["cat_layout"], '0') != 0 ? $_term_config['cat_layout'] : $wd_data['wd_prod_cat_layout']; $wd_data['wd_prod_cat_left_sidebar'] = isset($_term_config['cat_left_sidebar']) && strlen($_term_config['cat_left_sidebar']) > 0 && strcmp($_term_config["cat_left_sidebar"], '0') != 0 ? $_term_config['cat_left_sidebar'] : $wd_data['wd_prod_cat_left_sidebar']; $wd_data['wd_prod_cat_right_sidebar'] = isset($_term_config['cat_right_sidebar']) && strlen($_term_config['cat_right_sidebar']) > 0 && strcmp($_term_config["cat_right_sidebar"], '0') != 0 ? $_term_config['cat_right_sidebar'] : $wd_data['wd_prod_cat_right_sidebar']; $wd_data['wd_prod_cat_custom_content'] = isset($_term_config['cat_custom_content']) && strlen($_term_config['cat_custom_content']) > 0 ? $_term_config['cat_custom_content'] : (isset($wd_data['wd_prod_cat_custom_content']) ? $wd_data['wd_prod_cat_custom_content'] : ''); } } } if (isset($wd_data['wd_prod_cat_disc_grid']) && isset($wd_data['wd_prod_cat_disc_list'])) { add_action('wp_enqueue_scripts', 'wd_inline_style_list_grid_disc', 1000); } add_action('woocommerce_before_shop_loop', 'wd_remove_shop_archive_control', 1); add_action('woocommerce_after_shop_loop', 'wd_add_shop_archive_control', 1); } if (is_singular('product')) { global $wd_data, $post; /******************* Start Load Config On Single Post ******************/ $_prod_config = get_post_meta($post->ID, THEME_SLUG . 'custom_product_config', true); if (strlen($_prod_config) > 0) { $_prod_config = unserialize($_prod_config); if (is_array($_prod_config) && count($_prod_config) > 0) { $wd_data['wd_prod_layout'] = isset($_prod_config['layout']) && strlen($_prod_config['layout']) > 0 && strcmp($_prod_config["layout"], '0') != 0 ? $_prod_config['layout'] : $wd_data['wd_prod_layout']; $wd_data['wd_prod_left_sidebar'] = isset($_prod_config['left_sidebar']) && strlen($_prod_config['left_sidebar']) > 0 && strcmp($_prod_config["left_sidebar"], '0') != 0 ? $_prod_config['left_sidebar'] : $wd_data['wd_prod_left_sidebar']; $wd_data['wd_prod_right_sidebar'] = isset($_prod_config['right_sidebar']) && strlen($_prod_config['right_sidebar']) > 0 && strcmp($_prod_config["right_sidebar"], '0') != 0 ? $_prod_config['right_sidebar'] : $wd_data['wd_prod_right_sidebar']; } } /******************* End Config On Single Post ******************/ if (!$wd_data['wd_prod_image']) { remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20); } if (!$wd_data['wd_prod_label']) { remove_action('wd_single_before_product_image', 'wd_add_label_to_product', 10); } if (!$wd_data['wd_prod_title']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5); } if (!$wd_data['wd_prod_sku']) { remove_action('woocommerce_single_product_summary', 'wd_template_single_sku', 6); } if (!$wd_data['wd_prod_review']) { remove_action('woocommerce_single_product_summary', 'wd_template_single_review', 15); } if (!$wd_data['wd_prod_availability']) { remove_action('woocommerce_single_product_summary', 'wd_template_single_availability', 7); } if (!$wd_data['wd_prod_cart']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30); remove_action('woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30); remove_action('woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30); remove_action('woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30); remove_action('woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30); } if (!$wd_data['wd_prod_price']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 25); remove_action('woocommerce_single_variation', 'woocommerce_single_variation', 10); } if (!$wd_data['wd_prod_shortdesc']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 10); } if (!$wd_data['wd_prod_meta']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40); } if (!$wd_data['wd_prod_related']) { remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 15); add_filter("single_product_wrapper_class", "update_single_product_wrapper_class", 10); } else { global $post; $_product = wc_get_product($post); if (sizeof($_product->get_related()) == 0) { add_filter("single_product_wrapper_class", "update_single_product_wrapper_class", 10); } } if (!$wd_data['wd_prod_share']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 20); } if (!$wd_data['wd_prod_detail_banner']) { remove_action('woocommerce_after_single_product_summary', 'wd_template_single_banner', 5); } if (!$wd_data['wd_prod_ship_return']) { remove_action('wd_single_after_product_image', 'wd_template_shipping_return', 10); } if (!$wd_data['wd_prod_tabs']) { remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10); } if (!$wd_data['wd_prod_customtab']) { remove_filter('woocommerce_product_tabs', 'wd_addon_custom_tabs', 13); } if (isset($wd_data['wd_prod_upsell']) && !$wd_data['wd_prod_upsell']) { remove_action('woocommerce_after_single_product_summary', 'wd_upsell_display', 120); } } if ($wd_data['wd_catelog_mod'] == 1) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30); remove_action('woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30); remove_action('woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30); remove_action('woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30); remove_action('woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30); remove_action('woocommerce_after_shop_loop_item', 'wd_list_template_loop_add_to_cart', 8); //add to cart ajax remove_action('woocommerce_after_shop_loop_item_title', 'wd_list_template_loop_add_to_cart', 10); remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); remove_action('wd_quickshop_single_product_summary', 'woocommerce_template_single_add_to_cart', 11); } }
function wd_show_fredsel_slider($post_id) { if ((int) $post_id > 0) { $slider_datas = get_post_meta($post_id, 'wd_portfolio_slider', true); $slider_datas = unserialize($slider_datas); $slider_configs = get_post_meta($post_id, 'wd_slide_config', true); $slider_configs = wd_array_atts(array("portfolio_slider_config_autoslide" => 1, "portfolio_slider_config_size" => 'slider'), unserialize($slider_configs)); $_custom_size = $slider_configs['portfolio_slider_config_size']; $_width = 208; switch ($_custom_size) { case 'slideshow': $_width = 960; break; case 'slider': $_width = 222; break; case 'blog_thumb': $_width = 280; break; case 'prod_midium_thumb_1': $_width = 510; break; case 'prod_midium_thumb_2': $_width = 366; break; case 'prod_small_thumb': $_width = 141; break; case 'prod_tini_thumb': $_width = 75; break; case 'slider_thumb_wide': $_width = 150; break; case 'slider_thumb_box': $_width = 100; break; case 'related_thumb': $_width = 190; break; } if (is_array($slider_datas) && count($slider_datas) > 0) { $_random_id = "fredsel_" . $post_id . "_" . rand(); ob_start(); ?> <div class="featured_product_slider_wrapper shortcode_slider" id="<?php echo $_random_id; ?> "> <div class="fredsel_slider_wrapper_inner"> <ul> <?php foreach ($slider_datas as $_slider) { ?> <li> <a href="<?php echo $_slider['url']; ?> " title="<?php echo $_slider['slide_title']; ?> "> <?php echo wp_get_attachment_image($_slider['thumb_id'], $_custom_size, false, array('title' => $_slider['title'], 'alt' => $_slider['title'])); ?> </a> </li> <?php } ?> </ul> <div class="slider_control"> <a id="<?php echo $_random_id; ?> _prev" class="prev" href="#"><</a> <a id="<?php echo $_random_id; ?> _next" class="next" href="#">></a> </div> </div> </div> <script type='text/javascript'> //<![CDATA[ jQuery(document).ready(function() { // Using custom configuration jQuery("#<?php echo $_random_id; ?> > .fredsel_slider_wrapper_inner > ul").carouFredSel({ items : { width: <?php echo $_width; ?> ,height: 'auto'<?php //echo $slider_configs['portfolio_slider_config_height']; ?> ,visible: { min: 1 ,max: 5 } } ,direction : "left" ,responsive : true ,swipe : { onMouse: false, onTouch: true } ,scroll : { items : 1, duration : 1000 , pauseOnHover:true , easing : "easeInOutCirc"} ,width : '100%' ,height : '100%'<?php //echo $slider_configs['portfolio_slider_config_height']; ?> ,circular : true ,infinite : true ,auto : <?php echo (int) $slider_configs['portfolio_slider_config_autoslide'] == 1 ? "true" : "false"; ?> ,prev : '#<?php echo $_random_id; ?> _prev' ,next : '#<?php echo $_random_id; ?> _next' ,pagination : '#<?php echo $_random_id; ?> _pager' }); }); //]]> </script> <?php return ob_get_clean(); } } }
<?php global $post; $revolution_exists = class_exists('RevSlider') && class_exists('UniteFunctionsRev'); $datas = unserialize(get_post_meta($post->ID, THEME_SLUG . 'page_configuration', true)); $datas = wd_array_atts(array("page_layout" => '0', "main_content_layout" => 'box', "header_layout" => 'box', "footer_layout" => 'box', "main_slider_layout" => 'box', "banner_layout" => 'box', "page_column" => '0-1-0', "left_sidebar" => 'primary-widget-area', "right_sidebar" => 'primary-widget-area', "page_slider" => 'none', "page_revolution" => '', "page_flex" => '', "page_nivo" => '', "product_tag" => '', "portfolio_columns" => 1, "portfolio_filter" => 1, "hide_breadcrumb" => 0, "hide_title" => 0, "toggle_vertical_menu" => 1, "hide_slider_hot_product" => 1), $datas); ?> <div class="page_config_wrapper"> <div class="page_config_wrapper_inner"> <input type="hidden" value="1" name="_page_config"> <?php wp_nonce_field("_update_page_config", "nonce_page_config"); ?> <ul class="page_config_list"> <li class="first"> <p> <label><?php _e('Layout Style', 'wpdance'); ?> : <select name="page_layout" id="page_layout"> <option value="0" <?php if (strcmp($datas['page_layout'], '0') == 0) { echo "selected"; } ?> >Default</option> <option value="wide" <?php if (strcmp($datas['page_layout'], 'wide') == 0) { echo "selected"; }
function my_page_template_redirect() { global $wp_query, $post, $page_datas, $wd_data; $wd_data['wd_layout_style'] = isset($wd_data['wd_layout_styles']) ? $wd_data['wd_layout_styles'] : ''; if ($wp_query->is_page()) { global $page_datas, $wd_custom_style_config, $wd_data; $page_datas = unserialize(get_post_meta($post->ID, THEME_SLUG . 'page_configuration', true)); $page_datas = wd_array_atts(array("page_layout" => '0', "main_content_layout" => 'box', "header_layout" => 'box', "footer_layout" => 'box', "main_slider_layout" => 'box', "banner_layout" => 'box', "page_column" => '0-1-0', "left_sidebar" => 'primary-widget-area', "right_sidebar" => 'primary-widget-area', "page_slider" => 'none', "page_revolution" => '', "page_flex" => '', "page_nivo" => '', "product_tag" => '', "portfolio_columns" => 1, "portfolio_filter" => 1, "hide_breadcrumb" => 0, "hide_title" => 0, "hide_slider_hot_product" => 1, "toggle_vertical_menu" => 1), $page_datas); $wd_data['wd_layout_style'] = strcmp($page_datas['page_layout'], '0') == 0 ? isset($wd_data['wd_layout_styles']) ? $wd_data['wd_layout_styles'] : 'wide' : $page_datas['page_layout']; } if (is_tax('product_cat')) { global $wp_query, $category_prod_datas; $term = $wp_query->queried_object; $_term_config = get_metadata('woocommerce_term', $term->term_id, "cat_config", true); if (strlen($_term_config) > 0) { $_term_config = unserialize($_term_config); if (is_array($_term_config) && count($_term_config) > 0) { $wd_data['wd_prod_cat_column'] = isset($_term_config['cat_columns']) && strlen($_term_config['cat_columns']) > 0 && (int) $_term_config['cat_columns'] != 0 ? $_term_config['cat_columns'] : $wd_data['wd_prod_cat_column']; $wd_data['wd_prod_cat_layout'] = isset($_term_config['cat_layout']) && strlen($_term_config['cat_layout']) > 0 && strcmp($_term_config["cat_layout"], '0') != 0 ? $_term_config['cat_layout'] : $wd_data['wd_prod_cat_layout']; $wd_data['wd_prod_cat_left_sidebar'] = isset($_term_config['cat_left_sidebar']) && strlen($_term_config['cat_left_sidebar']) > 0 && strcmp($_term_config["cat_left_sidebar"], '0') != 0 ? $_term_config['cat_left_sidebar'] : $wd_data['wd_prod_cat_left_sidebar']; $wd_data['wd_prod_cat_right_sidebar'] = isset($_term_config['cat_right_sidebar']) && strlen($_term_config['cat_right_sidebar']) > 0 && strcmp($_term_config["cat_right_sidebar"], '0') != 0 ? $_term_config['cat_right_sidebar'] : $wd_data['wd_prod_cat_right_sidebar']; $wd_data['wd_prod_cat_custom_content'] = isset($_term_config['cat_custom_content']) && strlen($_term_config['cat_custom_content']) > 0 ? $_term_config['cat_custom_content'] : $wd_data['wd_prod_cat_custom_content']; } } } if (is_singular('product')) { global $wd_data, $post; /******************* Start Load Config On Single Post ******************/ $_prod_config = get_post_meta($post->ID, THEME_SLUG . 'custom_product_config', true); if (strlen($_prod_config) > 0) { $_prod_config = unserialize($_prod_config); if (is_array($_prod_config) && count($_prod_config) > 0) { $wd_data['wd_prod_layout'] = isset($_prod_config['layout']) && strlen($_prod_config['layout']) > 0 && strcmp($_prod_config["layout"], '0') != 0 ? $_prod_config['layout'] : $wd_data['wd_prod_layout']; $wd_data['wd_prod_left_sidebar'] = isset($_prod_config['left_sidebar']) && strlen($_prod_config['left_sidebar']) > 0 && strcmp($_prod_config["left_sidebar"], '0') != 0 ? $_prod_config['left_sidebar'] : $wd_data['wd_prod_left_sidebar']; $wd_data['wd_prod_right_sidebar'] = isset($_prod_config['right_sidebar']) && strlen($_prod_config['right_sidebar']) > 0 && strcmp($_prod_config["right_sidebar"], '0') != 0 ? $_prod_config['right_sidebar'] : $wd_data['wd_prod_right_sidebar']; if ((strcmp(trim($_prod_config['left_sidebar']), "0") != 0 || strcmp(trim($_prod_config['right_sidebar']), "0") != 0) && strcmp($wd_data['wd_prod_layout'], '0-1-0') != 0) { //we should replace the sidebar on product page if product have at least 1 sidebar // add_action( 'get_header', 'wd_init_sidebar_replacement' ); } } } /******************* End Config On Single Post ******************/ if (!$wd_data['wd_prod_image']) { remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20); } if (!$wd_data['wd_prod_label']) { remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10); } if (!$wd_data['wd_prod_title']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5); } if (!$wd_data['wd_prod_sku']) { remove_action('woocommerce_single_product_summary', 'wd_template_single_sku', 18); } if (!$wd_data['wd_prod_review']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 14); } //remove_action( 'woocommerce_single_product_summary', 'wd_template_single_review', 14 ); if (!$wd_data['wd_prod_availability']) { remove_action('woocommerce_single_product_summary', 'wd_template_single_availability', 16); } //remove_action( 'wd_single_product_summary_end', 'wd_template_single_availability', 16 ); if (!$wd_data['wd_prod_banner']) { remove_action('woocommerce_after_single_product_summary', 'wd_product_ad_banner', 5); } if (!$wd_data['wd_prod_cart']) { //remove_action( 'wd_single_product_summary_end', 'button_add_to_card', 16); remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30); remove_action('woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30); remove_action('woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30); remove_action('woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30); remove_action('woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30); } if (!$wd_data['wd_prod_price']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 29); } if (!$wd_data['wd_prod_shortdesc']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20); } if (!$wd_data['wd_prod_meta']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40); } if (!$wd_data['wd_prod_related']) { remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); add_filter("single_product_wrapper_class", "update_single_product_wrapper_class", 10); } else { global $post; $_product = get_product($post); if (sizeof($_product->get_related()) == 0) { add_filter("single_product_wrapper_class", "update_single_product_wrapper_class", 10); } } if (!$wd_data['wd_prod_share']) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 25); } if (!$wd_data['wd_prod_ship_return']) { remove_action('woocommerce_product_thumbnails', 'wd_template_shipping_return', 30); } if (!$wd_data['wd_prod_tabs']) { remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10); } if (!$wd_data['wd_prod_customtab']) { remove_filter('woocommerce_product_tabs', 'wd_addon_custom_tabs', 13); } if (isset($wd_data['wd_prod_upsell']) && !$wd_data['wd_prod_upsell']) { remove_action('woocommerce_after_single_product_summary', 'wd_upsell_display', 15); } } if ($wd_data['wd_catelog_mod'] == 0) { remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30); remove_action('woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30); remove_action('woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30); remove_action('woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30); remove_action('woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30); remove_action('woocommerce_after_shop_loop_item', 'wd_list_template_loop_add_to_cart', 8); //add to cart ajax remove_action('woocommerce_after_shop_loop_item_title', 'wd_list_template_loop_add_to_cart', 10); remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); remove_action('wd_quickshop_single_product_summary', 'woocommerce_template_single_add_to_cart', 11); } }