PclZipUtilRename

The WordPress Core PclZipUtilRename function.

Description

PclZipUtilRename( $p_src, $p_dest ); 

Parameters (2)

0. $p_src
The src.
1. $p_dest
The dest.

Usage

  1. if ( !function_exists( 'PclZipUtilRename' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/class-pclzip.php'; 
  3.  
  4. // The src. 
  5. $p_src = null; 
  6.  
  7. // The dest. 
  8. $p_dest = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = PclZipUtilRename($p_src, $p_dest); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/class-pclzip.php  
  1. function PclZipUtilRename($p_src, $p_dest) 
  2. $v_result = 1; 
  3.  
  4. // ----- Try to rename the files 
  5. if (!@rename($p_src, $p_dest)) { 
  6.  
  7. // ----- Try to copy & unlink the src 
  8. if (!@copy($p_src, $p_dest)) { 
  9. $v_result = 0; 
  10. else if (!@unlink($p_src)) { 
  11. $v_result = 0; 
  12.  
  13. // ----- Return 
  14. return $v_result;