[fr]
J'ai codé une extension à WordPress qui permet d'éditer les catégories de nombreux billets en un coup. L'écran liste par exemple tous les billets d'une catégorie, accompagnés d'un certain nombre de selects. On effectue les modifications que l'on désire et on soumet le formulaire entier en une fois.
[en]
Update 13.07: A more recent version is out!
I had planned to give you a write-up of the beginning of my WordPress experience today. Unfortunately, I decided to clean up my categories somewhat before I did that, and I managed to badly mess things up.
The result is that I spent most of my day writing a Batch Categories admin screen to help me clean things up. It was something I had planned to do, and I suppose it will also be useful to other people.
If you want to play around: copy the code above into a file named batch-categories.php in your wp-admin directory. I highly recommend that you back up your wp_post2cat table before you get going. This script works for me, but hasn’t been tested much, and comes with no guarantees. It is not optimised either, so depending on how many posts and categories you list, the screen can very well take over half a minute to load!
There are still a few functionalities I want to add, in particular: assigning all listed posts to a category in one go (or removing them).
If you want pretty integration with the other screens of the Edit menu, you’ll have to tweak the navigation bar in edit.php, edit-comments.php, and moderation.php.
Update 24.06.04: I’ve uploaded a screenshot of the admin screen so you can see what it could look like.
Update II 24.06.04: Instead of hacking the Edit menu bars, you can also access the Batch Categories screen from the Plugins page: create a file called batch-access.php (e.g.) in your plugins directory. (Beware not to leave any whitespace after the ?>, though, or you’ll get errors. Promised, zips and more detailed documentation will follow.
Update 04.07.04: I tried using the script this morning, and it seems nastily broken (removed all categories for some posts). Use with caution, and get back to me if ever you hack it or modify it, I’m interested! I’ll look into this once I get back home from Vienna.
Update 12.07.04: The script now works as it should! Thanks to Ben and MooKitty for helping me nail the big nasty bug which was driving me bonkers! Two improvements I’m working on right now: making the code more efficient by using the category cache, and adding a “add all listed posts to category X” option.
Similar Posts:
- Batch Categories 0.9
- Angst: My Categories are Still a Mess
- The Big 2009 Category Revolution
- Requirements for a WordPress Installer Script
- My Categories are a Mess
- Simple Technorati Tags Plugin for WordPress
- Tags and Categories, Oh My!
- Hack: Make Bunny Tags Point to Your Blog Tagspace
- Basic Bilingual 0.4
- Scripts for a WordPress Weblog Farm







UK Trip Report
The nice thing about having a laptop is that you can fire it up on the airplane and type in peace, without being distracted by IRC, instant messaging, e-mail and stats checking, or simple bloghopping. With iTunes in the background playing Bombay Dreams, my only concern is that the plane will start descending towards Geneva shortly.
My trip to the UK was short, and last-minute. I heard some people from #joiito were going to meet up in London on Sunday, I checked my easyjet flights, called Aleika–
“Ladies and Gentlemen, we will be landing shortly in Geneva. Please return to your seats, make sure your seatbelt is fastened and your seat is in the upright position, and switch off any electronic equipment.”
There goes the laptop, and I now find myself with a post which will be hard to date. Anyway. (Warning: this is a “cheese sandwich” post to some extent, so if you’re bored already, don’t bother reading it.)
Where was I? Yes, last-minute trip. I found a friend to house-and-cat-sit for me, which was nice, and spent the first couple of days at Aleika’s. We did our usual “girls at the movies” thing: get dressed up a bit, leave home late, grab some food which doesn’t come fast enough (well, it took long enough to arrive that I drank my pint of cider almost entirely before the meal, and can now testify that it’s all it takes to make my head spin quite a lot), jump into a cab and run to the theatre (slightly inebriated), only to find that the timings on the internet were incorrect, and we have another half-hour to wait before gleefully drooling all over Hugh Jackman in Van Helsing (OK, I got a bit carried away here, but you get the picture).
I got to spend nearly a whole day alone with Akirno, which was really nice. I didn’t get to see him much on my last visits. He’s grown so much! And he talks so much! (Yes, I know, that’s what I say each time I come back from Birmingham.) He’s a real sweetie. I love him very much.
Unfortunately, I caught a cold (over the top of my first one!) waiting for the bus after Van Helsing, so all my pre-London shopping was done in a rather feverish state. Looking at the bright side of things, it means I didn’t spend as much as I might have, which is a good thing, as my suitcase was already quite full enough (and my bank account empty enough, but that’s another story).
Driving to London went fine. We found a parking space right next to the Apollo Victoria Theatre. (Remember: Sunday matinée shows are a good idea if you’re going to London to see a musical or a play.) Bombay Dreams was really fun, specially as I know most of the songs Rahman re-used for the musical.
Still dressed up (I chose the pink dress), I headed for the #joiito meet-up. Despite this nagging feeling of being somewhat overdressed, and my cold, I had a very nice evening.
As always, though, I had to cope with the frustration of group meet-ups: not enough time to talk with everybody, not enough time to get into interesting conversations with those I talk to. Or maybe I’m just more of a one-to-one person? Anyway, standing invitation for any of you who would want to visit the beautiful town of Lausanne or practice French in the area — just drop me a line, or better (since e-mail is soon to be a dead form of communication, thanks to spam), catch me on IRC.
So, who was there? Well, as I’m nearing the ages of senility, I’m probably forgetting a lot of people, so please bear with me if you’re not mentioned, and let me know if it bothers you too much.
First of all, imajes, my kind host, who was so busy taking me through his iTunes collection on the train back that he missed his home stop. (Can it get worse than that?) Suw prevented me from being the only woman present (I can’t thank you enough for that). Joi was so utterly bored by my presence next to him that he left early to go back to his hotel and sleep — imagine that! (Actually, it seems jetlag also had something to do with it…)
I chatted quite a bit on the way there with imsickofmaps, and on the way back with snowchyld. Hugh managed to mess up my first blogcard somewhat (or whatever those things are called), so I am now the lucky owner of two of them. Gerard aka insert-coin took a nice bunch of photographs and has already put them online. I stole Suw’s camera to take a few photographs, but she’s not home yet, and those I took with my phone are stuck in there until I lay my hands on a Windows PC (thanks, Microsoft).
Apart from bumping my head on a couple of low doorways and leaving my coat there, I brought two things back (not literally) from james’ flat: VoodooPad, which I have not adopted as my official scrap-book application, and a book which made me discover a blog (how often has that happened to you?): Never Threaten to Eat Your Co-Workers: Best of Blogs, a collection of great weblog posts. I read a few pages, and it looked really neat. It’s on my wishlist now.
I think this post is long enough, for a short trip!
Similar Posts: