| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' ); |
| 3 |
|
| 4 |
/** |
| 5 |
* Set the default file permissions using FS_CHMOD_FILE from WP |
| 6 |
* |
| 7 |
* @since 1.2 |
| 8 |
* |
| 9 |
* @param string $file The path to file |
| 10 |
* @return bool |
| 11 |
**/ |
| 12 |
function imagify_chmod_file( $file ) { |
| 13 |
if ( ! defined( 'FS_CHMOD_FILE' ) ) { |
| 14 |
define( 'FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) ); |
| 15 |
} |
| 16 |
return @chmod( $file, FS_CHMOD_FILE ); |
| 17 |
} |