Title: [Plugin: Shadowbox JS] Suggestion: function check_for_src_file ()
Last modified: August 20, 2016

---

# [Plugin: Shadowbox JS] Suggestion: function check_for_src_file ()

 *  [Jacob Guite-St-Pierre](https://wordpress.org/support/users/jacobgsp/)
 * (@jacobgsp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-shadowbox-js-suggestion-function-check_for_src_file/)
 * Hi there,
 * I noticed your logic to check for the source files first check in the site’s 
   upload folder and if no upload basedir is set, it checks in the default uploads
   folder.
 * The code is the following:
 *     ```
       $uploads = wp_upload_dir ();
       if ( empty( $uploads['error'] ) && ! empty( $uploads['basedir'] ) )
       	$basedir = $uploads['basedir'];
       else
       	$basedir = WP_CONTENT_DIR . '/uploads';
   
       $status = true;
       if ( ! file_exists ( $basedir . '/shadowbox-js/src/intro.js' ) )
       	$status = false;
       ```
   
 * Which basically checks for the site upload directory before checking for the 
   default wp-content/uploads folder. I would however suggestion change the logic
   around so it checks in wp-content/uploads first.
 * I am currently working on a multisite installation of over 200 sites and I have
   to make sure the source files are present in each of the blogs.dir folders for
   each site, which could be very tedious. If you would however switch the logic
   around, meaning it checks for the default uploads first and then the site’s uploads
   folder, it would save a lot of time for multisite admins.
 * Thank you for the consideration.
 * [http://wordpress.org/extend/plugins/shadowbox-js/](http://wordpress.org/extend/plugins/shadowbox-js/)

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

 *  Plugin Author [Matt Martz](https://wordpress.org/support/users/sivel/)
 * (@sivel)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-shadowbox-js-suggestion-function-check_for_src_file/#post-2793261)
 * I have already made modifications the modifications to allow for a single location.
   It is not based on your suggestion but would require you to create an add on 
   plugin perhaps an mu-plugin to filter the location where the shadowbox src files
   would be located.
 * See [http://wordpress.org/support/topic/plugin-shadowbox-js-source-files-always-missing?replies=17#post-2825565](http://wordpress.org/support/topic/plugin-shadowbox-js-source-files-always-missing?replies=17#post-2825565)
 * The modifications have not yet been pushed into the repo…
 *  Thread Starter [Jacob Guite-St-Pierre](https://wordpress.org/support/users/jacobgsp/)
 * (@jacobgsp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-shadowbox-js-suggestion-function-check_for_src_file/#post-2793269)
 * Oh thank you, I’ll check it out.

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

The topic ‘[Plugin: Shadowbox JS] Suggestion: function check_for_src_file ()’ is
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shadowbox-js.svg)
 * [Shadowbox JS](https://wordpress.org/plugins/shadowbox-js/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shadowbox-js/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shadowbox-js/)
 * [Active Topics](https://wordpress.org/support/plugin/shadowbox-js/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shadowbox-js/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shadowbox-js/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jacob Guite-St-Pierre](https://wordpress.org/support/users/jacobgsp/)
 * Last activity: [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-shadowbox-js-suggestion-function-check_for_src_file/#post-2793269)
 * Status: not resolved