In Pods 2.0, we’ve simplified and cleaned up confusing names of functions and methods. Below is a comparison in case you’re familiar with Pods 1.x functionality. This will help you quickly migrate from any Pods 1.x site to Pods 2.x.
Note: Pods 2.x is backwards compatible with Pods 1.x code in most cases, but we still recommend you switch to the new syntax for future-proofing your site.
Contents
Compare Global Functions
| FUNCTIONALITY | PODS 1.X | PODS 2.0 |
|---|---|---|
| Run a SQL Query | pod_query() | pods_query() |
| Run Pods UI for Custom Admin screens | pods_ui_manage() | pods_ui() |
| MySQL Related functions | mysql_*() | Don’t use them, use WPDB or pods_query() |
Compare Pods object methods
| FUNCTIONALITY | PODS 1.X | PODS 2.0 |
|---|---|---|
| Get the Pods object | $pod = new Pod( ‘pod’ ) | $pod = pods( ‘pod’ ) |
| Get a field value | $pod->get_field() | $pod->field() |
| Display a field value | $pod->get_field() | $pod->display() |
| Find items | $pod->findRecords() | $pod->find() |
| Fetch the next item | $pod->fetchRecord() | $pod->fetch() |
| Get the current Pod item ID | $pod->get_pod_id() | $pod->id() |
| Get the pagination | $pod->getPagination() | $pod->pagination() |
| Get the search filters | $pod->getFilters() | $pod->filters() |
| Output a public form | $pod->publicForm() | $pod->form() |
| Total number of items found (regardless of ‘limit’) | $pod->getTotalRows() | $pod->total_found() |
| Total number of items returned | N/A | $pod->total() |
Compare PodsAPI object methods
| FUNCTIONALITY | PODS 1.X | PODS 2.0 |
|---|---|---|
| Get the PodsAPI object | $api = new PodAPI() | $api = pods_api() |
| Delete a Pod Item | $api->drop_pod_item() | $api->delete_pod_item() |
| Delete a Pod | $api->drop_pod() | $api->delete_pod() |
| Delete a Pod Field | $api->drop_column() | $api->delete_field() |
| Get a Pod Field | $api->load_column() | $api->load_field() |
| Save a Pod Field | $api->save_column() | $api->save_field() |
Compare Tables
| TABLE | PODS 1.X | PODS 2.0 |
|---|---|---|
| Pod Item Indexes | wp_pod | Removed and fields pushed into individual pod tables |
| Pod Items | wp_pod_tbl_* | wp_pods_* |
| Pod Relationships | wp_pod_rel | wp_podsrel |
| Pods | wp_pod_types | Removed and converted into a Custom Post Type |
| Pod Fields | wp_pod_fields | Removed and converted into a Custom Post Type |
| Pod Templates | wp_pod_templates | Removed and converted into a Custom Post Type |
| Pod Pages | wp_pod_pages | Removed and converted into a Custom Post Type |
| Pod Helpers | wp_pod_helpers | Removed and converted into a Custom Post Type |
Compare Other Functionality
| FUNCTIONALITY | PODS 1.X | PODS 2.0 |
|---|---|---|
| findRecords lookups | p.created, p.modified | t.created, t.modified |
| Templates and Helpers | $this points at the current Pod object | $obj points at the current Pods object |
| Input Helpers | Available | No longer supported |
| Multi-select Fields | Return array of field data if 1 set | Return arrays of array field data whether it’s 1 or more |