wpcf7_rmdir_p
The Contact Form 7 wpcf7 rmdir p function.
Description
wpcf7_rmdir_p( $dir );
Parameters (1)
- 0. $dir
- The dir.
Usage
if ( !function_exists( 'wpcf7_rmdir_p' ) ) { require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/functions.php'; } // The dir. $dir = null; // NOTICE! Understand what this does before running. $result = wpcf7_rmdir_p($dir);
Defined (1)
The function is defined in the following location(s).
- /includes/functions.php
- function wpcf7_rmdir_p( $dir ) {
- if ( is_file( $dir ) ) {
- if ( ! $result = @unlink( $dir ) ) {
- $stat = @stat( $dir );
- $perms = $stat['mode'];
- @chmod( $dir, $perms | 0200 ); // add write for owner
- if ( ! $result = @unlink( $dir ) ) {
- @chmod( $dir, $perms );
- }
- }
- return $result;
- }
- if ( ! is_dir( $dir ) ) {
- return false;
- }
- if ( $handle = @opendir( $dir ) ) {
- while ( false !== ( $file = readdir( $handle ) ) ) {
- if ( $file == "." || $file == ".." ) {
- continue;
- }
- wpcf7_rmdir_p( path_join( $dir, $file ) );
- }
- closedir( $handle );
- }
- return @rmdir( $dir );
- }