PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.2.2
Pods – Custom Content Types and Fields v3.2.2
trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / deprecated / classes / PodsAPI.php
pods / deprecated / classes Last commit date
Pods.php 4 years ago PodsAPI.php 4 years ago
PodsAPI.php
197 lines
1 <?php
2 require_once PODS_DIR . 'deprecated/deprecated.php';
3
4 /**
5 * @package Pods\Deprecated
6 */
7 class PodsAPI_Deprecated {
8
9 private $obj;
10
11 public $snap = false;
12
13 public $dt = 0;
14
15 public $dtname = '';
16
17 public $fields = array();
18
19 public $use_pod_id = false;
20
21 /**
22 * Constructor - PodsAPI Deprecated functionality (pre 2.0)
23 *
24 * @param object $obj The PodsAPI object
25 *
26 * @license http://www.gnu.org/licenses/gpl-2.0.html
27 * @since 2.0.0
28 */
29 public function __construct( $obj ) {
30 // backwards-compatibility with references to $this->var_name
31 $vars = get_object_vars( $obj );
32
33 foreach ( (array) $vars as $key => $val ) {
34 $this->{$key} = $val;
35 }
36
37 // keeping references pointing back to the source
38 $this->obj =& $obj;
39 }
40
41 /**
42 * Add or edit a column within a Pod
43 *
44 * $params['id'] int The field ID
45 * $params['pod_id'] int The Pod ID
46 * $params['pod'] string The Pod name
47 * $params['name'] string The field name
48 * $params['label'] string The field label
49 * $params['type'] string The column type ("txt", "desc", "pick", etc)
50 * $params['pick_object'] string The related PICK object name
51 * $params['pick_val'] string The related PICK object value
52 * $params['sister_id'] int (optional) The related field ID
53 * $params['weight'] int The field weight
54 * $params['options'] array The field options
55 *
56 * @param array $params An associative array of parameters
57 *
58 * @since 1.7.9
59 */
60 public function save_column( $params ) {
61 pods_deprecated( 'PodsAPI::save_field', '2.0' );
62
63 return $this->obj->save_field( $params );
64 }
65
66 /**
67 * Save the entire role structure
68 *
69 * @param array $params An associative array of parameters
70 *
71 * @since 1.7.9
72 * @return bool
73 */
74 public function save_roles( $params ) {
75 pods_deprecated( '[use WP roles and capabilities instead]', '2.0' );
76
77 return false;
78 }
79
80 /**
81 * Drop a Pod and all its content
82 *
83 * $params['id'] int The Pod ID
84 * $params['name'] string The Pod name
85 *
86 * @param array $params An associative array of parameters
87 *
88 * @since 1.7.9
89 */
90 public function drop_pod( $params ) {
91 pods_deprecated( 'PodsAPI::delete_pod', '2.0' );
92
93 return $this->obj->delete_pod( $params );
94 }
95
96 /**
97 * Drop a column within a Pod
98 *
99 * $params['id'] int The column ID
100 * $params['name'] int The column name
101 * $params['pod'] string The Pod name
102 * $params['pod_id'] string The Pod name
103 *
104 * @param array $params An associative array of parameters
105 *
106 * @since 1.7.9
107 */
108 public function drop_column( $params ) {
109 pods_deprecated( 'PodsAPI::delete_field', '2.0' );
110
111 return $this->obj->delete_field( $params );
112 }
113
114 /**
115 * Drop a Pod Template
116 *
117 * $params['id'] int The template ID
118 * $params['name'] string The template name
119 *
120 * @param array $params An associative array of parameters
121 *
122 * @since 1.7.9
123 */
124 public function drop_template( $params ) {
125 pods_deprecated( 'PodsAPI::delete_template', '2.0' );
126
127 return $this->obj->delete_template( $params );
128 }
129
130 /**
131 * Drop a Pod Page
132 *
133 * $params['id'] int The page ID
134 * $params['uri'] string The page URI
135 *
136 * @param array $params An associative array of parameters
137 *
138 * @since 1.7.9
139 */
140 public function drop_page( $params ) {
141 pods_deprecated( 'PodsAPI::delete_page', '2.0' );
142
143 return $this->obj->delete_page( $params );
144 }
145
146 /**
147 * Drop a Pod Helper
148 *
149 * $params['id'] int The helper ID
150 * $params['name'] string The helper name
151 *
152 * @param array $params An associative array of parameters
153 *
154 * @since 1.7.9
155 */
156 public function drop_helper( $params ) {
157 pods_deprecated( 'PodsAPI::delete_helper', '2.0' );
158
159 return $this->obj->delete_helper( $params );
160 }
161
162 /**
163 * Drop a single pod item
164 *
165 * $params['id'] int (optional) The item's ID from the wp_pod_* table (used with datatype parameter)
166 * $params['pod'] string (optional) The datatype name (used with id parameter)
167 * $params['pod_id'] int (optional) The datatype ID (used with id parameter)
168 * $params['bypass_helpers'] bool Set to true to bypass running pre-save and post-save helpers
169 *
170 * @param array $params An associative array of parameters
171 *
172 * @since 1.7.9
173 */
174 public function drop_pod_item( $params ) {
175 pods_deprecated( 'PodsAPI::delete_pod_item', '2.0' );
176
177 return $this->obj->delete_pod_item( $params );
178 }
179
180 /**
181 * Load a column
182 *
183 * $params['pod_id'] int The Pod ID
184 * $params['id'] int The field ID
185 * $params['name'] string The field name
186 *
187 * @param array $params An associative array of parameters
188 *
189 * @since 1.7.9
190 */
191 public function load_column( $params ) {
192 pods_deprecated( 'PodsAPI::load_column', '2.0', 'PodsAPI::load_field' );
193
194 return $this->obj->load_field( $params );
195 }
196 }
197