Archive for July, 2008

Wordpress manipulation using Javascript/DHTML instead of plugin hooks

Thursday, July 31st, 2008

One of Wordpress’ greatest features, which has undoubtedly contributed to its great success, is the plugin system. Plugin developers use the action and filter hooks offered by the plugin API to tap into the Wordpress system, without the need to hack the core code.

Whilst the list of action and filter hooks offered is substantial and affords much modification freedom, there are going to be times when there is no action or filter to do the job. I was recently asked to develop a plugin that added a few small things to the Wordpress administration backend. A quick browse of the plugin API led me to conclude that there was no plugin hook available which would directly enable me to modify the area in question. So I was about to edit the relevant core Wordpress files when I realised that I could end up indirectly using a plugin hook after all.

(more…)

Wordpress MU and the www prefix

Sunday, July 27th, 2008

Nowadays, the www prefix is considered to be a redundant relic. In order to support the no-www initiative, Wordpress MU is by default set up so that the www prefix is stripped from URLs. For example, if one typed in http://www.example.com to access a Wordpress MU installation, they would end up at http://example.com.

Now, for some reason it might be the case that you do want the www to remain (I don’t mind having the www stripped, but from my experiences with installing Wordpress MU for clients, it is often the case that they want the www prefix to remain). However, this is apparently not a straightforward thing to achieve in Wordpress MU.

(more…)

Enabling Theme Editor in Wordpress MU

Friday, July 25th, 2008

The theme editor in Wordpress is a nice little feature which allows administrators to, via the brower, edit the theme files available to the Wordpress installation.

For security reasons however, this feature is not part of Wordpress, the risk being that if the editor is available, then someone with access to it might maliciously change code.

If such a security risk is not a problem though and you want to enable the theme editor, you must do two things:

1. the file theme-editor.php is not included with Wordpres MU. So get a copy of it from a standard Wordpress source (it is under ‘/wp-admin/’) and place it under the ‘/wp-admin/’ folder of your Wordpress MU installation.
2. Edit line # 401 of the file ‘/wp-admin/includes/mu.php’ by commenting out or deleting the line:

unset( $submenu['themes.php'][10] );

For more on the perils of the theme editor in Wordpress MU and a neat plugin which allows users to make a copy of a system theme just for their blog, check out http://wpmudev.org/project/Userthemes-1.1