Selecting title, meta and multiple term names with MySQL

I often run one off reports for clients directly from the MySQL database behind their (normally WordPress) websites. Most are straightforward, perhaps requiring data from the wp_posts and wp_postmeta tables. However it get's a lot more complicated if term data is needed too. This is because determining which terms belong to an object, what taxonomy… Read more Selecting title, meta and multiple term names with MySQL

Avoiding permissions problems when creating Zip files in PHP

A typical PHP snippet to create a Zip file looks something like this: $zip = new ZipArchive(); $zipname = ‘package_name.zip’; if ( true === $zip->open( $zipname, ZipArchive::CREATE ) ) { $zip->addFromString( ‘file_name.txt’, $file_contents ); $zip->close(); header( ‘Content-Type: application/zip’ ); header( ‘Content-disposition: attachment; filename=’ . $zipname ); header( ‘Content-Length: ‘ . filesize( $zipname ) ); readfile(… Read more Avoiding permissions problems when creating Zip files in PHP

Affiliated or sponsored content – disclaimers, ethics and styling

Just to be clear – there are no affiliate links, sponsored content or anything similar in this post. Recently I started taking the JavaScript for WordPress course and would highly recommend it. Not long after I received an email from them promoting their affiliate system – help advertise the course and you get a kick-back.… Read more Affiliated or sponsored content – disclaimers, ethics and styling