In an earlier ticket I requested if Taxopress Pro would have the ability to add products to product categories based on certain words. For instance when I have a category called Reading Lights and I want both products containing reading lights and book lights added to it.
Now I do read something about a regular expression function within auto terms. Could this regular expression not expand the auto term function with one extra word by adding it like this:
stristr( $content, book light )
Would this expression not also add products that have the word book light in them to the product category i’m targeting in this case?
]]>How can I accomplish this?
]]>“Character [x] is not supported.”
regardless of what number I start with. I’ve tested every pattern with an onlin regex tester and they all PASS. So I don’t know what the heck is going on?
This is the most basic pattern that should work.
]]>\d{3}[-]\d{3}[-]\d{4}
I would like to exclude certain plugins in all product pages. As I have hundreds of product pages, I was wondering if I could exclude certain plugins in a permalink using a regular expression like:
www.chefpanda.pt/produto/.*
Is this possible?
PS: I followed this link in order to exclude the contact form 7 plugin in all pages but the contact page. When I do that, the form doesn′t work. It does show up, but when you fill in form and click on the button “send”, it never gets the success message. Have you already noticed this issue?
Best regards,
Ricardo
The actual code to search and replace looks like this:
$buffer = preg_replace( $find, $far_settings['farreplace'][$key], $buffer );
So you can use PHP style regular expressions and backreferences ($1, $2, etc).
]]>Secondary question
My site is a multi-site. my present sub-site url is https://babousanchez.aljabal.be/
What should my source and my target be if I want that the redirection concernes all sites (main site and all sub-sites)? I can’t find the answer in your “Regular expressions” doc.
Thanks in advance for your attention,
Fran
I’m stuck using a different redirect plugin in the meantime (and searching for an nginx workaround for that plugin) because I need regex support.
Add that feature and this will be the only redirect plugin my team needs!
]]>So I tried it and… they didn’t work. Somehow I didn’t notice that I need to check the regex box next to redirection settings box (far right on the site). Luckily, developer of this plugin was kind and awesome enough to answer on my support thread here and I figured out that I just need to check this regex checbox and finally redirection works perfectly.
My redirect is like this:
/shop/(.*)
https://mynewsite.pl/shop/$1
It’s just awesome, simple and powerful plugin!
Remember, if something seems not to work, try support first and don’t give hasty one star reviews because like in my case, it can be a simple thing and in the end plugin works great!
]]>Woocommerce currently displaying phone numbers like 03125001234. However, I need the number to be formatted in a more human-readable form, for example: 0-312-500-12-34.
I found a jQuery code in SO similar to my need
$('.phone').text(function(i, text) {
return text.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3');
});
But how can i customize it? So it would put 0(Zero) prewritten and customer would be starting with his number after zero and which class should i call this jQuery for WooCommerce Cart section
https://stackoverflow.com/questions/8760070/how-to-format-a-phone-number-with-jquery
]]>^(.|\n){0,5600}$