PodsAPI_Deprecated

The Pods - Custom Content Types and Fields PodsAPI Deprecated class.

Defined (1)

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

/deprecated/classes/PodsAPI.php  
  1. class PodsAPI_Deprecated { 
  2.  
  3. private $obj; 
  4.  
  5. var $snap = false; 
  6.  
  7. var $dt = 0; 
  8.  
  9. var $dtname = ''; 
  10.  
  11. var $fields = array(); 
  12.  
  13. var $use_pod_id = false; 
  14.  
  15. /** 
  16. * Constructor - PodsAPI Deprecated functionality (pre 2.0) 
  17. * @param object $obj The PodsAPI object 
  18. * @license http://www.gnu.org/licenses/gpl-2.0.html 
  19. * @since 2.0 
  20. */ 
  21. public function __construct ( $obj ) { 
  22. // backwards-compatibility with references to $this->var_name 
  23. $vars = get_object_vars( $obj ); 
  24.  
  25. foreach ( (array) $vars as $key => $val ) { 
  26. $this->{$key} = $val; 
  27.  
  28. // keeping references pointing back to the source 
  29. $this->obj =& $obj; 
  30.  
  31. /** 
  32. * Add or edit a column within a Pod 
  33. * $params['id'] int The field ID 
  34. * $params['pod_id'] int The Pod ID 
  35. * $params['pod'] string The Pod name 
  36. * $params['name'] string The field name 
  37. * $params['label'] string The field label 
  38. * $params['type'] string The column type ("txt", "desc", "pick", etc) 
  39. * $params['pick_object'] string The related PICK object name 
  40. * $params['pick_val'] string The related PICK object value 
  41. * $params['sister_id'] int (optional) The related field ID 
  42. * $params['weight'] int The field weight 
  43. * $params['options'] array The field options 
  44. * @param array $params An associative array of parameters 
  45. * @since 1.7.9 
  46. */ 
  47. public function save_column ($params) { 
  48. pods_deprecated( 'PodsAPI::save_field', '2.0' ); 
  49.  
  50. return $this->obj->save_field( $params ); 
  51.  
  52. /** 
  53. * Save the entire role structure 
  54. * @param array $params An associative array of parameters 
  55. * @since 1.7.9 
  56. */ 
  57. public function save_roles ($params) { 
  58. pods_deprecated( '[use WP roles and capabilities instead]', '2.0' ); 
  59.  
  60. return false; 
  61.  
  62. /** 
  63. * Drop a Pod and all its content 
  64. * $params['id'] int The Pod ID 
  65. * $params['name'] string The Pod name 
  66. * @param array $params An associative array of parameters 
  67. * @since 1.7.9 
  68. */ 
  69. public function drop_pod ( $params ) { 
  70. pods_deprecated( 'PodsAPI::delete_pod', '2.0' ); 
  71.  
  72. return $this->obj->delete_pod( $params ); 
  73.  
  74. /** 
  75. * Drop a column within a Pod 
  76. * $params['id'] int The column ID 
  77. * $params['name'] int The column name 
  78. * $params['pod'] string The Pod name 
  79. * $params['pod_id'] string The Pod name 
  80. * @param array $params An associative array of parameters 
  81. * @since 1.7.9 
  82. */ 
  83. public function drop_column ( $params ) { 
  84. pods_deprecated( 'PodsAPI::delete_field', '2.0' ); 
  85.  
  86. return $this->obj->delete_field( $params ); 
  87.  
  88. /** 
  89. * Drop a Pod Template 
  90. * $params['id'] int The template ID 
  91. * $params['name'] string The template name 
  92. * @param array $params An associative array of parameters 
  93. * @since 1.7.9 
  94. */ 
  95. public function drop_template ( $params ) { 
  96. pods_deprecated( 'PodsAPI::delete_template', '2.0' ); 
  97.  
  98. return $this->obj->delete_template( $params ); 
  99.  
  100. /** 
  101. * Drop a Pod Page 
  102. * $params['id'] int The page ID 
  103. * $params['uri'] string The page URI 
  104. * @param array $params An associative array of parameters 
  105. * @since 1.7.9 
  106. */ 
  107. public function drop_page ( $params ) { 
  108. pods_deprecated( 'PodsAPI::delete_page', '2.0' ); 
  109.  
  110. return $this->obj->delete_page( $params ); 
  111.  
  112. /** 
  113. * Drop a Pod Helper 
  114. * $params['id'] int The helper ID 
  115. * $params['name'] string The helper name 
  116. * @param array $params An associative array of parameters 
  117. * @since 1.7.9 
  118. */ 
  119. public function drop_helper ( $params ) { 
  120. pods_deprecated( 'PodsAPI::delete_helper', '2.0' ); 
  121.  
  122. return $this->obj->delete_helper( $params ); 
  123.  
  124. /** 
  125. * Drop a single pod item 
  126. * $params['id'] int (optional) The item's ID from the wp_pod_* table (used with datatype parameter) 
  127. * $params['pod'] string (optional) The datatype name (used with id parameter) 
  128. * $params['pod_id'] int (optional) The datatype ID (used with id parameter) 
  129. * $params['bypass_helpers'] bool Set to true to bypass running pre-save and post-save helpers 
  130. * @param array $params An associative array of parameters 
  131. * @since 1.7.9 
  132. */ 
  133. public function drop_pod_item ( $params ) { 
  134. pods_deprecated( 'PodsAPI::delete_pod_item', '2.0' ); 
  135.  
  136. return $this->obj->delete_pod_item( $params ); 
  137.  
  138. /** 
  139. * Load a column 
  140. * $params['pod_id'] int The Pod ID 
  141. * $params['id'] int The field ID 
  142. * $params['name'] string The field name 
  143. * @param array $params An associative array of parameters 
  144. * @since 1.7.9 
  145. */ 
  146. public function load_column ($params) { 
  147. pods_deprecated( 'PodsAPI::load_column', '2.0', 'PodsAPI::load_field' ); 
  148.  
  149. return $this->obj->load_field( $params );