wp_clone

Copy an object.

Description

(object) wp_clone( (object) $object ); 

Returns (object)

The cloned object.

Parameters (1)

0. $object (object)
The object to clone.

Usage

  1. if ( !function_exists( 'wp_clone' ) ) { 
  2. require_once ABSPATH . WPINC . '/load.php'; 
  3.  
  4. // The object to clone. 
  5. $object = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_clone($object); 
  9.  

Defined (1)

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

/wp-includes/load.php  
  1. function wp_clone( $object ) { 
  2. // Use parens for clone to accommodate PHP 4. See #17880 
  3. return clone( $object );