PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 2.7.31.4
Pods – Custom Content Types and Fields v2.7.31.4
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 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 3 days ago PodsAPI.php 3 days ago
PodsAPI.php
207 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
31 // backwards-compatibility with references to $this->var_name
32 $vars = get_object_vars( $obj );
33
34 foreach ( (array) $vars as $key => $val ) {
35 $this->{$key} = $val;
36 }
37
38 // keeping references pointing back to the source
39 $this->obj =& $obj;
40 }
41
42 /**
43 * Add or edit a column within a Pod
44 *
45 * $params['id'] int The field ID
46 * $params['pod_id'] int The Pod ID
47 * $params['pod'] string The Pod name
48 * $params['name'] string The field name
49 * $params['label'] string The field label
50 * $params['type'] string The column type ("txt", "desc", "pick", etc)
51 * $params['pick_object'] string The related PICK object name
52 * $params['pick_val'] string The related PICK object value
53 * $params['sister_id'] int (optional) The related field ID
54 * $params['weight'] int The field weight
55 * $params['options'] array The field options
56 *
57 * @param array $params An associative array of parameters
58 *
59 * @since 1.7.9
60 */
61 public function save_column( $params ) {
62
63 pods_deprecated( 'PodsAPI::save_field', '2.0' );
64
65 return $this->obj->save_field( $params );
66 }
67
68 /**
69 * Save the entire role structure
70 *
71 * @param array $params An associative array of parameters
72 *
73 * @since 1.7.9
74 * @return bool
75 */
76 public function save_roles( $params ) {
77
78 pods_deprecated( '[use WP roles and capabilities instead]', '2.0' );
79
80 return false;
81 }
82
83 /**
84 * Drop a Pod and all its content
85 *
86 * $params['id'] int The Pod ID
87 * $params['name'] string The Pod name
88 *
89 * @param array $params An associative array of parameters
90 *
91 * @since 1.7.9
92 */
93 public function drop_pod( $params ) {
94
95 pods_deprecated( 'PodsAPI::delete_pod', '2.0' );
96
97 return $this->obj->delete_pod( $params );
98 }
99
100 /**
101 * Drop a column within a Pod
102 *
103 * $params['id'] int The column ID
104 * $params['name'] int The column name
105 * $params['pod'] string The Pod name
106 * $params['pod_id'] string The Pod name
107 *
108 * @param array $params An associative array of parameters
109 *
110 * @since 1.7.9
111 */
112 public function drop_column( $params ) {
113
114 pods_deprecated( 'PodsAPI::delete_field', '2.0' );
115
116 return $this->obj->delete_field( $params );
117 }
118
119 /**
120 * Drop a Pod Template
121 *
122 * $params['id'] int The template ID
123 * $params['name'] string The template name
124 *
125 * @param array $params An associative array of parameters
126 *
127 * @since 1.7.9
128 */
129 public function drop_template( $params ) {
130
131 pods_deprecated( 'PodsAPI::delete_template', '2.0' );
132
133 return $this->obj->delete_template( $params );
134 }
135
136 /**
137 * Drop a Pod Page
138 *
139 * $params['id'] int The page ID
140 * $params['uri'] string The page URI
141 *
142 * @param array $params An associative array of parameters
143 *
144 * @since 1.7.9
145 */
146 public function drop_page( $params ) {
147
148 pods_deprecated( 'PodsAPI::delete_page', '2.0' );
149
150 return $this->obj->delete_page( $params );
151 }
152
153 /**
154 * Drop a Pod Helper
155 *
156 * $params['id'] int The helper ID
157 * $params['name'] string The helper name
158 *
159 * @param array $params An associative array of parameters
160 *
161 * @since 1.7.9
162 */
163 public function drop_helper( $params ) {
164
165 pods_deprecated( 'PodsAPI::delete_helper', '2.0' );
166
167 return $this->obj->delete_helper( $params );
168 }
169
170 /**
171 * Drop a single pod item
172 *
173 * $params['id'] int (optional) The item's ID from the wp_pod_* table (used with datatype parameter)
174 * $params['pod'] string (optional) The datatype name (used with id parameter)
175 * $params['pod_id'] int (optional) The datatype ID (used with id parameter)
176 * $params['bypass_helpers'] bool Set to true to bypass running pre-save and post-save helpers
177 *
178 * @param array $params An associative array of parameters
179 *
180 * @since 1.7.9
181 */
182 public function drop_pod_item( $params ) {
183
184 pods_deprecated( 'PodsAPI::delete_pod_item', '2.0' );
185
186 return $this->obj->delete_pod_item( $params );
187 }
188
189 /**
190 * Load a column
191 *
192 * $params['pod_id'] int The Pod ID
193 * $params['id'] int The field ID
194 * $params['name'] string The field name
195 *
196 * @param array $params An associative array of parameters
197 *
198 * @since 1.7.9
199 */
200 public function load_column( $params ) {
201
202 pods_deprecated( 'PodsAPI::load_column', '2.0', 'PodsAPI::load_field' );
203
204 return $this->obj->load_field( $params );
205 }
206 }
207