Category Archives: WordPress
Parse Error When Installing WordPress 3.2 on a PHP4 Server
This is the error you’ll get if you try to install WordPress 3.2 on a PHP4 server:
Parse error: parse error, unexpected T_VARIABLE in /path/to/your/directory/wp-includes/load.php on line 566
It’s because the clone keyword doesn’t exist in PHP4.
admin-ajax.php Response Fails When Called from Domain Alias
Uploading Files with Custom Post Types
If you’re building a custom post type and want to let the user upload files, you’ll need to add enctype=”multipart/form-data” to the form tag, using the post_edit_form_tag filter. Otherwise the $_FILES array will be empty.
Creating Custom Post Types With Extra Fields
Richard Shepherd’s post on creating custom post types in WordPress is the first good example I’ve found that covers adding extra data fields.
Determining WordPress Paths and URLs
Using Chained Properties Inside $wpdb->prepare()
Capturing WordPress Plugin Activation Errors
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.