@@ 172-196 (lines=25) @@ | ||
169 | 'session_tokens', |
|
170 | ), |
|
171 | ); |
|
172 | } elseif ( 'post' === $object_type ) { |
|
173 | $object_table_structure = array( |
|
174 | 'object_name' => 'post', |
|
175 | 'content_methods' => array( |
|
176 | 'create' => 'wp_insert_post', |
|
177 | 'read' => 'get_posts', |
|
178 | 'update' => 'wp_update_post', |
|
179 | 'delete' => 'wp_delete_post', |
|
180 | 'match' => 'get_posts', |
|
181 | ), |
|
182 | 'meta_methods' => array( |
|
183 | 'create' => 'add_post_meta', |
|
184 | 'read' => 'get_post_meta', |
|
185 | 'update' => 'update_post_meta', |
|
186 | 'delete' => 'delete_post_meta', |
|
187 | 'match' => 'WP_Query', |
|
188 | ), |
|
189 | 'content_table' => $this->wpdb->prefix . 'posts', |
|
190 | 'id_field' => 'ID', |
|
191 | 'meta_table' => $this->wpdb->prefix . 'postmeta', |
|
192 | 'meta_join_field' => 'post_id', |
|
193 | 'where' => 'AND ' . $this->wpdb->prefix . 'posts.post_type = "' . $object_type . '"', |
|
194 | 'ignore_keys' => array(), |
|
195 | ); |
|
196 | } elseif ( 'category' === $object_type || 'tag' === $object_type || 'post_tag' === $object_type ) { |
|
197 | // I am unsure why post_tag wasn't here for so long, but i figure it probably needs to be there. |
|
198 | $object_table_structure = array( |
|
199 | 'object_name' => 'term', |
|
@@ 245-269 (lines=25) @@ | ||
242 | 'where' => '', |
|
243 | 'ignore_keys' => array(), |
|
244 | ); |
|
245 | } else { // This is for custom post types. |
|
246 | $object_table_structure = array( |
|
247 | 'object_name' => 'post', |
|
248 | 'content_methods' => array( |
|
249 | 'create' => 'wp_insert_post', |
|
250 | 'read' => 'get_posts', |
|
251 | 'update' => 'wp_update_post', |
|
252 | 'delete' => 'wp_delete_post', |
|
253 | 'match' => 'get_posts', |
|
254 | ), |
|
255 | 'meta_methods' => array( |
|
256 | 'create' => 'add_post_meta', |
|
257 | 'read' => 'get_post_meta', |
|
258 | 'update' => 'update_post_meta', |
|
259 | 'delete' => 'delete_post_meta', |
|
260 | 'match' => 'WP_Query', |
|
261 | ), |
|
262 | 'content_table' => $this->wpdb->prefix . 'posts', |
|
263 | 'id_field' => 'ID', |
|
264 | 'meta_table' => $this->wpdb->prefix . 'postmeta', |
|
265 | 'meta_join_field' => 'post_id', |
|
266 | 'where' => 'AND ' . $this->wpdb->prefix . 'posts.post_type = "' . $object_type . '"', |
|
267 | 'ignore_keys' => array(), |
|
268 | ); |
|
269 | } // End if(). |
|
270 | ||
271 | return $object_table_structure; |
|
272 | } |