If you’re using $wpdb->prepare() to query a custom table, you can’t pass the table name in as an argument because it will be single-quoted, which would be a MySQL syntax error. Instead, you need to insert the variable directly into the double-quoted query string and let PHP parse it out. That creates a new problem, […]
Capturing WordPress Plugin Activation Errors
If you’re developing a plugin and there are any PHP errors/warnings you’ll get a message like this when you activate it: The plugin generated [x] characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin. You don’t actually see […]
The Correct Way to Roll Cables
This video explains the right way to roll cables, alternating over- and under-hand loops to maintain the natural curve of the cable. Using this method helps avoid knots, makes it quicker to unravel, reduces wear on the cable and makes it easier to get a clean, symmetrical coil. The video is geared towards audio cables, but […]
How to Find a Twitter User’s RSS Feed
Twitter has always offered RSS feeds for user’s tweets, but unfortunately they stopped publishing the URLs awhile back. The feeds are still active, though, so you just have to manually figure out the URL. The first thing you’ll need to do is use this website to find their ID based on their username. Then, just […]
Reserved WordPress URL Parameters
Using a reserved WordPress URL parameter (like “year” or “m”) on the front end will cause a 404 error.
Directory Permissions for WordPress under Plesk/Linux
Jason Diehl describes the right way to setup directory permissions on a Linux box running Plesk so that WordPress can automatically create the directories it uses to store uploads. Basically, you need to make sure that PHP’s safe mode is turned off and that wp-content is owned by apache, in the apache group, and chmod’d to 777.
Overwrite Uploads Plugin
I just checked a new plugin called Overwrite Uploads into the WordPress.org repository. It gives users the option to overwrite existing files when uploading rather than WordPress’ default behavior, which is to add a 1 to the end of the filename, e.g., filename1.jpg.