[wp-hackers] [WP1.5 Idea] Admin Setting for Alternate Path to Themes

Ryan Boren ryan at boren.nu
Sat Feb 12 21:09:59 GMT 2005


On Sat, 2005-02-12 at 12:21 -0800, Doug Daulton wrote:
> Wow.  That was quick!  Can I have a pony too?  I've always wanted one.  ;)
> 
> Seriously, thanks Ryan.  I suppose I need to pull down the latest 
> nightly build?

You'll need tonight's nightly.

> Also, I am unfamiliar with the WP API, but have plenty
> of coding savvy.  So, can you point me at a URL that gets me started 
> with this hook structure you are talking about and I'll take it from there.

Here's the plugin you need.

<?
/*
Plugin Name:  Theme Root
Plugin URI: http://wordpress.org/#
Description: Set a custom theme root.
Author:
Version: 1.0
Author URI:
*/

function tr_set_theme_root($theme_root) {
        return ABSPATH . "themes";
}

function tr_set_theme_root_uri($theme_root) {
        return get_settings('siteurl') . "/themes";
}


add_filter('theme_root', 'tr_set_theme_root');
add_filter('theme_root_uri', 'tr_set_theme_root_uri');

?>



More information about the hackers mailing list