Created
September 26, 2023 16:29
-
-
Save kyletaylored/9ec4da1f643a295413765f560da057ad to your computer and use it in GitHub Desktop.
Fix bfi_thumb.php for Pantheon directories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create the upload subdirectory, this is where | |
// we store all our generated images | |
if ( defined( 'BFITHUMB_UPLOAD_DIR' ) ) { | |
$upload_dir .= "/" . BFITHUMB_UPLOAD_DIR; | |
$upload_url .= "/" . BFITHUMB_UPLOAD_DIR; | |
} else { | |
$upload_dir .= "/bfi_thumb"; | |
$upload_url .= "/bfi_thumb"; | |
} | |
// Patch upload directory value for creating new directories based on manipulations. | |
$param_hash = md5(implode('', array_values(ksort($params) ? $params : $params))); | |
$upload_dir .= "/{$param_hash}"; | |
$upload_url .= "/{$param_hash}"; | |
if ( ! is_dir( $upload_dir ) ) { | |
wp_mkdir_p( $upload_dir ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment