This file contains 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
add_rewrite_rule('sushi-cats/([^/]*)/metro/([^/]*)/?$','index.php?product_cat=$matches[1]&metro=$matches[2]','top'); | |
add_rewrite_rule('sushi-cats/(sushi|roll|set)/metro/([^/]*)/?$','index.php?product_cat=$matches[1]&metro=$matches[2]','top'); |
This file contains 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 uni_add_rewrite_rules() { | |
add_rewrite_rule('sushi-cats/([^/]*)/metro/([^/]*)/?$','index.php?product_cat=$matches[1]&metro=$matches[2]','top'); | |
add_rewrite_rule('sushi-cats/(sushi|roll|set)/metro/([^/]*)/?$','index.php?product_cat=$matches[1]&metro=$matches[2]','top'); | |
} | |
add_action( 'init', 'uni_add_rewrite_rules' ); |
This file contains 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 uni_add_rewrite_tag() { | |
add_rewrite_tag('%metro%', '([^&]+)'); | |
} | |
add_action('init', 'uni_add_rewrite_tag', 10, 0); |
This file contains 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 uni_add_query_vars( $public_query_vars ) { | |
$public_query_vars[] .= 'metro'; | |
return $public_query_vars; | |
} | |
add_filter('query_vars', 'uni_add_query_vars'); |
This file contains 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 | |
/* | |
* Template Name: Contact Form | |
*/ | |
get_header(); ?> | |
<h1>Контактна форма</h1> | |
<?php if ( 'success' == get_query_var( 'form' ) ): ?> | |
<div class="message"> | |
Ваше повідомлення надіслано! |
This file contains 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 | |
if ( ! defined( 'ABSPATH' ) ) exit; | |
class WordPress_Plugin_Template_Settings { | |
private $dir; | |
private $file; | |
private $assets_dir; | |
private $assets_url; | |
private $settings_base; |
This file contains 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
/** | |
* Reads attributes from the item | |
* | |
* @param $productData | |
* @param $product | |
* @return array | |
*/ | |
protected function populateAttributes($productData, $product) | |
{ | |
$attributes = []; |
This file contains 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
add_action( 'wp', 'uni_checkout_under_certain_circumstances' ); | |
function uni_checkout_under_certain_circumstances() { | |
if ( function_exists( 'is_checkout' ) && ( is_checkout() || is_ajax() ) ) { | |
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 ); | |
// the following line disables "notes" field | |
add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); | |
// an example of unsetting checkout fields | |
add_filter( 'woocommerce_checkout_fields', 'uni_unset_billing_checkout_fields', 10, 1 ); | |
// an example of modifying atributtes of checkout fields |
This file contains 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
const flickty = jQuery('.woocommerce-product-gallery__wrapper').data('flickity'); | |
if (typeof flickty !== 'undefined' && flickty.slides.length > 1) { | |
flickty.destroy(); | |
jQuery('.woocommerce-product-gallery__wrapper').flickity({ | |
draggable: false | |
}); | |
} |
This file contains 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
add_action( 'woocommerce_product_options_pricing', 'uni_display_fields' ); | |
add_action( 'woocommerce_process_product_meta', 'uni_save_fields' ); | |
function uni_display_fields() { | |
woocommerce_wp_text_input( | |
array( | |
'id' => 'uni_paired_meta', | |
'label' => 'Meta field paired with NOV', | |
'description' => 'This value will be used instead of {uni_nov_cpo_paired_meta}', | |
) |
OlderNewer