Title: Wrong upload folder
Last modified: June 13, 2024

---

# Wrong upload folder

 *  Resolved [lukechinworth](https://wordpress.org/support/users/lukechinworth/)
 * (@lukechinworth)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/wrong-upload-folder/)
 * With Block Editor Colors plugin active, when we upload to the media library the
   file is being put in an old folder (2023/03, current date is 2024/06). This is
   because get_post(0) is returning the first block_editor_color likely due to global
   $post polution. We determined this was caused by the WP_Query in CustomColorsService.
   php set_colors. I see the wp_reset_postdata() after the loop, but for some reason
   it’s not reseting it. Can you change the WP_Query to get_posts to avoid this 
   issue?
 *     ```wp-block-code
       	private function set_colors() {		$args = array(			'post_type' => $this->color_cpt_slug,			'orderby'   => 'menu_order',			'order'     => 'ASC',			'numberposts'  => -1		);		$posts           = get_posts( $args );		$colors          = [];		$disabled_colors = [];		foreach($posts as $post) {			if ( $post->post_status === 'publish' ) {				$colors[ $post->ID ] = [					'name'  => $post->post_title,					'slug'  => get_post_meta( $post->ID, 'slug', true ),					'color' => get_post_meta( $post->ID, 'color', true ),				];			} else {				$disabled_colors[ $post->ID ] = [					'name'  => $post->post_title,					'slug'  => get_post_meta( $post->ID, 'slug', true ),					'color' => get_post_meta( $post->ID, 'color', true ),				];			}		}		$this->custom_colors          = $colors;		$this->disabled_custom_colors = $disabled_colors;	}
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Eugene White](https://wordpress.org/support/users/eugenewhite/)
 * (@eugenewhite)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/wrong-upload-folder/#post-17839120)
 * Hello there!
 * I apologize for the delayed response. 
 * I wanted to let you know that I have replicated the issue on my end and have 
   escalated it to our developers. 
 * I’m hopeful that they will implement a solution in the next plugin release. 
 * We inform you as soon as we have any updates on this matter.
 *  Plugin Support [Eugene White](https://wordpress.org/support/users/eugenewhite/)
 * (@eugenewhite)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/wrong-upload-folder/#post-17841954)
 * Hello there! 
 * I hope you’re doing well.
   I’m pleased to announce that the Block Editor Colors
   plugin version 1.2.6 has been released. In this version, we have fixed the issues
   related to the incorrect media upload folder. So update the plugin and let us
   know if there’s something we can help you with.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Wrong upload folder’ is closed to new replies.

 * ![](https://ps.w.org/block-editor-colors/assets/icon.svg?rev=2267506)
 * [Block Editor Colors](https://wordpress.org/plugins/block-editor-colors/)
 * [Support Threads](https://wordpress.org/support/plugin/block-editor-colors/)
 * [Active Topics](https://wordpress.org/support/plugin/block-editor-colors/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-editor-colors/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-editor-colors/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Eugene White](https://wordpress.org/support/users/eugenewhite/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/wrong-upload-folder/#post-17841954)
 * Status: resolved