Created
March 27, 2016 12:35
-
-
Save sjaved87/320a2bc984909c584eac to your computer and use it in GitHub Desktop.
This small snippet will disable the use of year month format to store media on signup.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpmudev_set_default_media_settings( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { | |
update_blog_option( $blog_id, $option = 'uploads_use_yearmonth_folders', $value = 0, $deprecated ); | |
} | |
add_action( 'wpmu_new_blog', 'wpmudev_set_default_media_settings',10, 6 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't you need to do
switch_to_blog($blog_id);
andrestore_current_blog();
before and after this code?