When using TwentySeventeen theme, if you have a function with a simple new WP_Query with any argument like this in the functions.php:
function wp123_qry_in_widgets_init() {
$test_qry = new WP_Query( array( 'posts_per_page' => 3 ) );
if ( $test_qry->have_posts() ) :
while ( $test_qry->have_posts() ) :
$test_qry->the_post();
endwhile;
wp_reset_postdata();
endif;
}
And then hook it on to the widgets_init action with:
add_action( 'widgets_init', 'wp123_qry_in_widgets_init' );
Something weird happens when you go to Media -> Add new. When you upload a new image now, the image goes into a seemingly random upload date folder.
For instance, I did it just now and new images are uploaded to 2016/11. Without that function added, the images are uploaded normally to 2017/01.
Why is this unexpected behavior happening?