I have a client who wants to show a list of their posts ordered by the numerical value of a post meta field (custom fields are referred to as post meta data in the WordPress code, so I’ll be following that convention from now on). Unfortunately there doesn’t seem to be a way to do this using query_posts or by creating a new WP_Query object, which makes life a little trickier. Continue reading ‘Ordering post meta value, numerically’
Monthly Archive for July, 2009
This bug has been around for a little while now, and one of my clients has it bad as they cannot save user profiles without patches to WP core. (Unfortunately although WordPress Trac has tickets (#9640, #7540) the discussion over how the problem needs to be fixed has been going on for a couple of WP releases now.)
The symptoms are the following error:
Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in /home/halfbets/public_html/wp-includes/wp-db.php on line 445
The solution is outlined in this WP support post, but does involve editing core WP files so does require both some knowledge and a brave heart (and the willingness to repeat the exercise if the problem isn’t fixed the next time you upgrade).
So you’ve migrated a bunch of users over from another system and then, horror, you discover that they don’t have roles in WordPress. The WP Users admin screen doesn’t cope with this issue (why should it), so the only option would be to go through and manually select the roles for each user with no role… fine, right? Except I just migrated 8,000 ish users and there’s no way my meta carpels will take that abuse. This plugin finds any users on your system with no role and gives them the role of ‘subscriber’, it does this in batches of 1,000 users per page load and once it has finished it replaces your entire blog with a message saying it’s finished… so don’t leave it running unattended kids, eh? (I know that’s rude, but coding “echo ‘blah; exit;’ is SO much quicker and it’s only a dirty data migration tool.
You can download the source here: Fix Users with No Role – Data Migration tool as WordPress plugin
So I’ve just had to migrate a whole load of data to bbPress, and unfortunately the fairly old migration tool I was using (while generally excellent) didn’t bring across the topic-slugs, meaning I couldn’t have pretty permalinks in bbPress. So I’ve written a quick plugin which creates the topic slugs, it does this by doing 1000 at a time every time the page loads, then it very rudely bangs up a big text notice telling you it’s done and you should remove the plugin… at this point bbPress won’t work until you remove the plugin. You have been warned. I couldn’t be bothered with polite messages as this is a one use migration tool.
Here it is: bbPress create topic slugs plugin – data migration tool only
Updated version, this one also create forum slugs: bbPress create forum and topic slugs plugin – data migration tool only
Recent Comments