• Resolved Gal Baras

    (@galbaras)


    Hi Daan,

    On my sites, backups include wp-content/uploads, but not wp-content/cache, so I prefer to have the OMGF cache in the latter.

    Also, logically, it’s a cache, not an upload directory.

    Please bring back the cache location setting. It’s already in the Advanced tab, which some people may avoid, but I don’t.

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hi Gal,

    Advanced users can still change the cache directory using the omgf_upload_dir and omgf_upload_url filters.

    Thread Starter Gal Baras

    (@galbaras)

    Thanks, @daanvandenbergh .

    If anyone’s interested, this works:

    add_filter( 'omgf_upload_dir', 'omgf_modify_upload_dir' );
    function omgf_modify_upload_dir() {
    	return WP_CONTENT_DIR . '/cache/omgf';
    }
    Thread Starter Gal Baras

    (@galbaras)

    Sorry, but this doesn’t change the URL of the stylesheet, only the font files 🙁

    Thread Starter Gal Baras

    (@galbaras)

    Found it. Here’s the full code:

    add_filter( 'omgf_upload_dir', 'omgf_modify_upload_dir' );
    function omgf_modify_upload_dir() {
    	return WP_CONTENT_DIR . '/cache/omgf';
    }
    
    add_filter( 'omgf_upload_url', 'omgf_modify_upload_url' );
    function omgf_modify_upload_url() {
    	return WP_CONTENT_URL . '/cache/omgf';
    }

    Side note: it might be good to filter the path BEFORE attaching the WP_CONTENT_DIR/URL constants, because then a single filter will do.

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

The topic ‘Please bring back cache location setting’ is closed to new replies.