[wp-hackers] Theme Creation on Install ?

Nikolay Bachiyski nbachiyski at developer.bg
Mon Aug 1 14:17:18 GMT 2005


Matt Mullenweg wrote:
> Jason Bainbridge wrote:
> 
>> I noticed that myself the other day, the changeset that implemented it 
>> was:
>>
>> http://trac.wordpress.org/changeset/2037
>>
>> But that was back in January and I'm sure that theme didn't pop up
>> until recently.
> 
> 
> Part of the problem we noted at the time is that if you change the name 
> of your blog and re-upgrade it'll create a new theme. This is still 
> unresolved. Maybe we should use the domain instead of the name?
> 

There are some more problems with that automatic theme creation.

If the blog name contains non-ascii characters it is passed to 
sanitize_title() to create a string, which is a valid folder name. After 
  that the theme could not be activated, because the name of theme 
(residing in its style.css) is different from the directory name (the 
sanitized string).

Here we have several options:
- when trying to activate a theme pass the 'template' and 'stylesheet' 
parameters to sanitize_title() to ensure our 'non-ascii' theme will 
successfully be activated. However thus activation of other themes (for 
example these, containg spaces), whose names will change after going 
through sanitize_title().
- set the name of theme to be its sanitized name. Beleieve me, I really 
do not want my theme to be named: %d0%b1%d0%b0%d0%b1%d0%b0. Actually I 
do not want same-named directory also.
- in style.css put not only the theme name, but also the name of the 
sub-directory of wp-content/themes it resides in
- do not automatically create local version of the current theme
- the best option, I just couldn't think of, but maybe somebody will ;)

Nikolay.


More information about the wp-hackers mailing list