Category: Uncategorized
-
Customizing pages with Stylish
I fell in love with Stylish when I got myself new, prettier Googles with it. There are lots of contributed styles for other high-profile places as well, but I found myself tweaking the most obscure of sites, which generally suffer more from downright uglyness than those well-known and much-visited ones do. I’d feel stupid offering my humble pieces of CSS to stand alongside the elaborate sorcery carefully crafted by others, so I’ve set up my own repository for my userstyles.
-
Fixing my plugin's SQL for WordPress 2.3
I just upgraded WordPress to version 2.3 RC 1 at my test blog, and found out that changes in the taxonomy schema break my Parental Control plugin in a nasty way. Fortunately, it was quite easy to fix.
I added a test for WordPress’ version and branched the SQL accordingly:
if (version_compare(get_bloginfo('version'), '2.3-RC1', '<')) { $text .= " AND ( '".$jupc_excluded_cat."' ALL (SELECT category_id FROM $wpdb->post2cat WHERE $wpdb->post2cat.post_id = $wpdb->posts.ID) )"; } else { $text .= " AND ( '".$jupc_excluded_cat."' ALL (SELECT term_taxonomy_id FROM $wpdb->term_relationships WHERE $wpdb->term_relationships.object_id = $wpdb->posts.ID) )"; }
The code above reserved for versions 2.3 RC1 and above would probably work with the 2.3 Betas as well, but as I don’t have any interest in testing already obsolete versions, I decided to draw the line to 2.3 RC1, so the code above probably won’t work with 2.3 trunk versions below RC1.