pods_register_type

Add a new Pod outside of the DB.

Description

(array|boolean) pods_register_type( (string) $type, (string) $name, (null) $object = null ); 

Returns (array|boolean)

Pod data or false if unsuccessful

Parameters (3)

0. $type (string)
The pod type ('post_type', taxonomy,, media, user, comment)
1. $name (string)
The pod name
2. $object — Optional. (null) => null
Pod array, including any fields arrays

Usage

  1. if ( !function_exists( 'pods_register_type' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'pods-custom-content-types-and-fields/includes/general.php'; 
  3.  
  4. // The pod type ('post_type', 'taxonomy', 'media', 'user', 'comment') 
  5. $type = ''; 
  6.  
  7. // The pod name 
  8. $name = ''; 
  9.  
  10. // (optional) Pod array, including any 'fields' arrays 
  11. $object = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pods_register_type($type, $name, $object); 
  15.  

Defined (1)

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

/includes/general.php  
  1. function pods_register_type ( $type, $name, $object = null ) { 
  2. if ( empty( $object ) ) 
  3. $object = array(); 
  4.  
  5. if ( !empty( $name ) ) 
  6. $object[ 'name' ] = $name; 
  7.  
  8. return pods_meta()->register( $type, $object );