Last week I had a short hickup of Woocommerce regarding the numbers count of a few custom taxonomies. Then I noticed there is actually no function in WordPress to easily recount terms in WordPress. In Woocommerce settings there is a ‘recount terms’ function, but it looks like it doens’t recount any custom taxonomies you have working with Woo, only it’s own terms. Other than that, there is no button of the sorts to recounts terms anywhere.
I have been fiddling around with Regular Expressions these days. As most people who ever tried it know that you can do about anything but it is at the same time nearly impossible.
Instead of making a test page, altering and refreshing minor changes all day I decided to look around a bit for a handy tool. There are a lot of them out there but I found a nice one.
The cool thing is you can easily switch between modes, modifiers and it automatically refreshed. The only minor point is that it is sometimes hard to see the difference between no match and an expression crash.
Check it out: Online regular expressions tester
Let me know if you found a better one!
A word of warning. I just updated to PHP 5.4 which broke my installation because call-time-pass-by-reference has been removed in this version. See: passing by reference.
Along with some other functions you shouldn’t be using anymore anyway. See the incompatible list.
For up-to-date plugins and software this shouldn’t be a problem since it was deprecated for a while already.
For me it notably breaks the Feedwordpress plugin in WordPress and gives a fatal error, which is annoying. A simple solution is present but you need to dive into the code and replace a few lines. See the solution here.
I fear older plugins of various kinds are also vulnerable for this problem, so I advice to check your installation locally against a new php version to see if any problems arise before your host decides to upgrade their installation!
I ran into this interesting feature yesterday I was not aware of. If you are trying to put options WordPress using Update_option serializing the data before actually causes unexpected behaviour.
The catch is that WordPress already serializes data send to the function. When invoking get_option the data will be unserialized. Obviously this causes an error if you try to unserialize the whole thing after that.
In short, just push an unserialized array unto update_option and everything will be fine!
update_option("stuff",array('foo','bar')); $foobar = get_option("stuff");
See this blog post for more backgrounds.