Skip to content

Commit 0d9c44f

Browse files
committed
plugins: Enable option_uploads_use_yearmonth_folders on blogs
Avoid overriding the dated upload dirs, since these are used on blogs. Ref jquery/infrastructure-puppet#17.
1 parent 216c81d commit 0d9c44f

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

plugins/jquery-filters.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@
6262

6363
// Disable WordPress auto-paragraphing for posts, except on actual blog sites
6464
remove_filter( 'the_content', 'wpautop' );
65+
66+
add_filter( 'option_uploads_use_yearmonth_folders', '__return_false' );
67+
68+
add_filter( 'upload_dir', function( $upload_dir ) {
69+
if ( defined( 'UPLOADS' ) ) {
70+
$upload_dir['path'] = $upload_dir['basedir'] = UPLOADS;
71+
} else {
72+
$upload_dir['path'] = $upload_dir['basedir'] = WP_CONTENT_DIR . '/uploads';
73+
}
74+
75+
return $upload_dir;
76+
});
6577
}
6678

6779
// Disable WordPress text transformations (smart quotes, etc.) for posts.
@@ -128,17 +140,6 @@ function jquery_unfiltered_html_for_term_descriptions() {
128140
return $classes;
129141
});
130142

131-
add_filter( 'option_uploads_use_yearmonth_folders', '__return_false' );
132-
add_filter( 'upload_dir', function( $upload_dir ) {
133-
if ( defined( 'UPLOADS' ) ) {
134-
$upload_dir['path'] = $upload_dir['basedir'] = UPLOADS;
135-
} else {
136-
$upload_dir['path'] = $upload_dir['basedir'] = WP_CONTENT_DIR . '/uploads';
137-
}
138-
139-
return $upload_dir;
140-
});
141-
142143
add_filter( 'get_terms', function( $terms, $taxonomies, $args ) {
143144
if ( !isset( $args[ 'orderby' ] ) || $args[ 'orderby' ] !== 'natural' ) {
144145
return $terms;

0 commit comments

Comments
 (0)