WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Jacob Guite-St-Pierre
    Member
    Posted 2 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'];
    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/

  2. Matt Martz
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 years ago #

    Oh thank you, I'll check it out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.