When creating a new network site, by default the site option Uploads Use Yearmonth Folders
is on (set to 1
). I have to set it to 0
each time I create a new site. This isn't horrid, but is it possible to make this the default for newly created sites? Perhaps a hook or something I am overlooking?
2 Answers
You could just change the option after the blog is created:
add_action('wpmu_new_blog', function($blog_id){
switch_to_blog($blog_id);
update_option('uploads_use_yearmonth_folders', false);
restore_current_blog();
});
Drop this code into a .php file inside wp-content/mu-plugins
-
Awesome, knew I had to be missing something wpmu-related. Thanks! Sep 13, 2011 at 3:12
I'm a little confused by your question. Are you referring to URLs? If so go to Settings > Permalinks and adjust from there.
-
1No, not the URL. It's the option to sort uploads into year/month folders, which is on by default for new sites in a multisite setting and there's no media setting to turn it off. I have to set it either in the DB or in the network admin site settings screen (which is really just a light DB GUI). Jul 15, 2011 at 1:31