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