WordPress filter to add HAVING clause to SQL

There’s posts_fields, posts_join, posts_where, posts_groupby but strangely there’s no WordPress filter named posts_having and it took many Google searches to find anything which might present a solution, and when I did find something it had precisely one upvote and hadn’t even been accepted as the answer. It’s not necessarily a robust solution, it depends on… Read more »

Obscure fix for AJAX requests that queue

I just found and fixed a major performance bottleneck in a web application I’ve been working on. The application consists of a single page populated with various dynamic graphs, the data for which is loaded via around 10 separate ajax requests which fire periodically to update the graphs and statistics. It appeared, watching the network… Read more »

Coda Plugin for WordPress Hook completion

WordPress hides a lot of functionality behind its filter/action hooks. Unfortunately these are generally inaccessible to many an IDE via code completion because they’re held within opaque strings. Coda, my preferred IDE, is affected, but since it’s extensible there are many plugins available to provide additional functionality. As I was unable to find a plugin… Read more »

Yet another way in which your server might prevent file uploads

So, you’ve created a form for your application which allows file submissions. You’ve checked your php.ini file and made sure that post_max_size, upload_max_filesize and memory_limit have all been set large enough to accommodate your expected filesize. You’ve got a hidden input field named MAX_FILE_SIZE and correctly set the value in bytes, but your file uploads… Read more »

Custom query filtered by meta_value that is an array

It’s a bit of a hack, but… So begins practically every solution I find regarding WordPress issues. Here’s another one. I wanted to query posts by meta_value but the data, generated by Advanced Custom Fields, is in serialised array form in the database table. Searching for a general solution for what must be a common… Read more »