This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //do not copy this line | |
// Add in exporting site | |
add_filter('wt_alter_product_reviews_export_csv_data', 'wt_alter_product_reviews_export_csv_data'); | |
function wt_alter_product_reviews_export_csv_data($csv_row) { | |
if (isset($csv_row['meta:reviewx_attachments']) && !empty($csv_row['meta:reviewx_attachments'])) { | |
$images_url = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wt_iew_cron_interval_details', 'wt_iew_cron_interval_details_fn'); | |
function wt_iew_cron_interval_details_fn($schedules) { | |
$schedules['wt_iew_cron_interval'] = array( | |
'interval' => (60), //60 second | |
'display' => __('Every minute'), | |
); | |
return $schedules; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wt_mime_types($mime_types) { | |
$mime_types['webp'] = 'image/webp'; //Adding webp extension | |
return $mime_types; | |
} | |
add_filter('upload_mimes', 'wt_mime_types', 1, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wt_woocommerce_product_import_inserted_product_object', 'wt_woocommerce_product_import_inserted_product_object', 10, 2); | |
function wt_woocommerce_product_import_inserted_product_object($product, $data) { | |
if (isset($data['meta_data'])) { | |
foreach ($data['meta_data'] as $meta) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('wt_woocommerce_product_importer_pre_parse_data', 'wt_woocommerce_product_importer_pre_parse_feed_data'); | |
function wt_woocommerce_product_importer_pre_parse_feed_data($mapped_data) { | |
$wt_gpf_data_array = array('meta:wt_gpf_title', 'meta:wt_gpf_availability', 'meta:wt_gpf_brand', 'meta:wt_gpf_mpn', 'meta:wt_gpf_product_type', 'meta:wt_gpf_google_product_category', 'meta:wt_gpf_size_system'); | |
$gpf_data = array(); | |
foreach ($mapped_data as $mkey => $mvalue) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow Shop Managers to add another shop manager/custom role | |
*/ | |
function wt_shop_manager_role_edit_capabilities($roles) { | |
$roles[] = 'shop_manager'; // change role here for custom roles | |
$roles[] = 'customrole'; // change role here for custom roles | |
return $roles; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_footer', 'wt_cli_add_href_to_links'); | |
function wt_cli_add_href_to_links() { | |
if (class_exists('Cookie_Law_Info')) { | |
?> | |
<script> | |
jQuery(function($) { | |
wt_cli_links = $('#cookie-law-info-bar a, #cliSettingsPopup a'); | |
wt_cli_links.each(function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wt_cli_add_rel_preload($html, $handle, $href, $media) { | |
$preload = array( | |
'cookie-law-info', | |
'cookie-law-info-gdpr', | |
'cookie-law-info-table' | |
); | |
if (in_array($handle, $preload)) { | |
return '<link rel="preload" as="style" onload="this.onload=null;this.rel=' . "'stylesheet'" . '" id="' . $handle . '-css" href="' . $href . '" type="text/css" media="all" />' . "\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_footer', 'wt_cli_remove_conflict_click_event'); | |
function wt_cli_remove_conflict_click_event() { | |
if (class_exists('Cookie_Law_Info')) { | |
?> | |
<script> | |
jQuery(function() { | |
setTimeout(function() { | |
jQuery('.cli-modal-body a[data-target]').off('click'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wt_move_gdpr_script_to_footer() { | |
if (class_exists('Cookie_Law_Info')) { | |
wp_dequeue_script('cookie-law-info'); | |
wp_enqueue_script('cookie-law-info', '', array(), false, true); | |
} | |
} | |
add_action( 'admin_enqueue_scripts', 'wt_move_gdpr_script_to_footer', 999 ); |