I think you are all up to date with the Canonical URL: Google, Yahoo, Live, the jointventure versus unintentional duplicate content ;) Learn more on Matt Cutt's blog.
It's a somehow cool thing but it fits best Wordpress Blogs where URLs can get into trouble every now and then. This is my second plugin related to Wordpress URLs after the Permalink Diet, which I will update these days with a bunch of new extra features based on this very plugin.
Read the rest of this entry »
Scraping with RegExp is most of the times effective enough but, every now and then, you will need to make more advanced queries on the DOM to reach the elements you need or to have the DOM fix very peculiar HTML errors that just don't make sense in the mind of a HTML aware coders. I'm not saying it's not doable in RegExp but this approach might be actually easier for those who think RegExp is EVAL.
Read the rest of this entry »
Wordpress coding practices sometimes baffle me.
Custom Columns for posts / pages / users / categories are very important to me as a plugin developer who likes to hack into the Wordpress interface rather than creating his own menus in the wp-admin panel! But these days I noticed Wordpress 2.7.1 is broken in terms of custom_columns. Custom columns work for posts and pages but they don't for categories and users. You can add them but they are not even called in the row listings: user_row function and _cat_row function.
Read the rest of this entry »
I wanted a simple method to handle some output buffering when coding plugins. Let's take this situation. You want to alter the_content filter but you want to make the modifications inline.
To manage inline HTML in PHP you got two options: regular string ... impossible. HEREDOCs ... not good for complex PHP code. So you are left with regular ?>HTML + PHP<?php. But returning this as a variable is not trivial. You need to output buffer it by using ob_start(); ... HTML + PHP code ... $html = ob_get_contents(); ob_end_clean();. And this will allow you to wrap inside a variable any kind of complex HTML code thanks to super output buffering in PHP.
Read the rest of this entry »