WordPress.org

Ready to get started?Download WordPress

Forums

File Un-Attach
redundant reference and compat fix (4 posts)

  1. alx359
    Member
    Posted 3 years ago #

    See please comment in code.

    file-unattach.php li ~95

    function load_dependencies(){
    		if(is_admin() && !class_exists('FunAdmin'))
    			require_once(dirname(__FILE__).'/admin.php');
    		//[alx359] When image-store not installed, this #include produces multiple redundant calls
    		//to pre_get_images/db via pre_get_posts hook, and incompatibility with cleaner-gallery WP::get_children()
    		//elseif(!class_exists('ImStoreFront'))
    			//require_once(dirname(__FILE__).'/front.php');
    	}

    Would suggest a check for !empty constant or global specific to image-store, before #include of front.php.

  2. Hax
    Member
    Plugin Author

    Posted 3 years ago #

    ignore

  3. Hax
    Member
    Plugin Author

    Posted 3 years ago #

    actually it should be checking for the "FunFront" class, not the ImStoreFront, I but I will fix this on the next release thank you

  4. alx359
    Member
    Posted 3 years ago #

    Thank to you for this very useful and straightforward plugin! Much appreciated.

    AFAIU, one needs FunFront only if image-store is installed, and it shouldn't be included other ways. One would need to check something like tnis:

    elseif(defined('MY_IMAGESTORE_CONSTANT') && !class_exists('FunFront'))
        require_once(dirname(__FILE__).'/front.php');

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic