Title: Uploads don&#8217;t show, bool(false) changed empty string
Last modified: July 5, 2017

---

# Uploads don’t show, bool(false) changed empty string

 *  [tomoki](https://wordpress.org/support/users/tomoki/)
 * (@tomoki)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/uploads-dont-show-plugin-changes-boolfalse-to-empty-string/)
 * New uploads don’t show on my site with the plugin enabled.
 * I tracked down the bug to your plugin:
    running `replace_host_name()` on the `'
   upload_dir'` filter has the side effect as below.
 * Before running the filter:
 *     ```
       $uploads['error'] = bool(false)
       ```
   
 * After running the filter:
 *     ```
       $uploads['error'] = string(0) ""
       ```
   
 * This is because `replace_host_name()` relies on `str_replace()`, which, when 
   passed an array, apparently changes booleans to strings.
 * This makes the `wp_get_attachment_url()` think there is an error, and reverts
   the attachment’s URL to the GUID. In my case those are the URLs from the staging
   server, which means some images don’t show up. (And those that do show are all
   from the staging server, which is incorrect anyway.)
 * I’m not sure if this is a problem with the plugin being too aggresive, or it’s
   more a bug with `str_replace()`. I’ve googled it but didn’t find anything useful.
 * I had to disable the plugin to make the site work.
    -  This topic was modified 8 years, 11 months ago by [tomoki](https://wordpress.org/support/users/tomoki/).

The topic ‘Uploads don’t show, bool(false) changed empty string’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/dynamic-hostname_1b95bb.svg)
 * [Dynamic Hostname](https://wordpress.org/plugins/dynamic-hostname/)
 * [Support Threads](https://wordpress.org/support/plugin/dynamic-hostname/)
 * [Active Topics](https://wordpress.org/support/plugin/dynamic-hostname/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dynamic-hostname/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dynamic-hostname/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [tomoki](https://wordpress.org/support/users/tomoki/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/uploads-dont-show-plugin-changes-boolfalse-to-empty-string/)
 * Status: not resolved