Skip to content

Instantly share code, notes, and snippets.

@khvoroffski
khvoroffski / query_cyrillic_attribute_values.md
Created February 13, 2021 14:33 — forked from trey8611/query_cyrillic_attribute_values.md
WP All Import - use XPath Query based on Cyrillic attribute value

XPath doesn't allow you to make queries with Cyrillic symbols unless you disable XML pre-processing by adding this code in your child themes functions.php file (or in a plugin like Code Snippets: https://wordpress.org/plugins/code-snippets/):

function wpai_is_xml_preprocess_enabled( $is_enabled ) {
	return false;
}
add_filter( 'is_xml_preprocess_enabled', 'wpai_is_xml_preprocess_enabled', 10, 1 );

Once that code is in place, upload your file to an import and queries like this will be possible:

@khvoroffski
khvoroffski / functions.php
Created November 15, 2018 08:46 — forked from danielbitzer/functions.php
AutomateWoo - Add email restriction to uniquely generated workflow coupons
<?php
// added in v3.3.3
add_filter( 'automatewoo/variables/coupons/use_email_restriction', '__return_true' );