Shadowbox JS
Suggestion: function check_for_src_file () (3 posts)

  1. Jacob Guite-St-Pierre
    Posted 4 years ago #

    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'];
    	$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.


  2. Matt Martz
    Plugin Author

    Posted 4 years ago #

    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

    The modifications have not yet been pushed into the repo...

  3. Jacob Guite-St-Pierre
    Posted 4 years ago #

    Oh thank you, I'll check it out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Shadowbox JS
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.