add_meta_box not working
My metaboxes suddenly stopped working. If that’s the case for you, and you are clueless, try resetting $id for your meta_box
Queries are only available after “wp” action hook, so ‘init’ is too early to check for it.
So I wasn’t able to add new items to wordpress menu and found out that the reason is the POST limit but adding max_input_vars = 2000 did not solve the problem (default is 1000). If you have suhosin and cant add new menu items or save your menu, you have to add the below to your…
Time and again i fall for this same simple mistake. This may not be intuitive in the context of serialized arrays. If you fetch a serialized array with this method you want $single to be true to actually get an unserialized array back. If you pass in false, or leave it out, you will have…
I needed a placeholder for tags input but it’s boring to display the same tags every time. But unlike posts, WP doesnt have “rand” orderby paramater. So what you can do; is to get a #no of tags and shuffle them. So basically what we do is: Check if we have a recent transient If…
I was working on an autocomplete solution and I was thinking of ways to speed up the search. I will be providing a few examples with results below. Q1 is the default wordpress search with no parameters. Q2 removes the caches since they wont be really necessary. And Q3 is tailored for precision; ie: my…
If you are familiar with WordPress, you should already know that you should almost never have to use get_posts(). Your best bet is to use WP_Query . As good as wp_query is, you should still fine-tune it depending on your needs, it does make a difference. For example, if you just need 1 random post…