Pods Block Bindings API

Since Pods 3.2, you have the ability to bind a custom field value to certain blocks in WordPress.

Custom Field binding

To do this, you’ll want to ensure you set up your Pods and fields accordingly:

  • Pods Admin > Settings > Performance > Register meta fields > Enable
  • Pods Admin > Edit Pods > Edit your pod > REST API > Enable
  • Pods Admin > Edit Pods > Edit your pod > REST API > Show all fields (or edit the fields you want to make them available)
  • Pods Admin > Edit Pods > Edit your pod > REST API > Field Location > Include in the meta object

There’s no ability to start linking a custom field from the UI in WordPress core as of WP 6.9.x — you must use the custom field metadata markup manually by editing your content as code through the editor.

<!-- wp:paragraph {
	"metadata": {
		"bindings": {
			"content": {
				"source": "core/post-meta",
				"args": {
					"key": "your_field_name"
				}
			}
		}
	}
} -->
<p></p>
<!-- /wp:paragraph -->

Custom Binding Source

Pods provides a custom binding source that unlocks much more than just custom fields for post types. You can now link the output of the Pods shortcode (which powers Pods Blocks).

It takes the same arguments that you would pass the shortcode. This allows you to embed a Field Value, a template for a Single Item, a template for a Item List, and other features that are supported by the shortcode.

The primary use-case for this binding source is to use it for embedding a field value.

<!-- wp:paragraph {
	"metadata": {
		"bindings": {
			"content": {
				"source": "pods/bindings-field",
				"args": {
					"name":  "your_pod",
					"id":  "1234",
					"field":  "your_field_name"
				}
			}
		}
	}
} -->
<p></p>
<!-- /wp:paragraph -->

Access Rights

For all block binding integration within Pods, we use the corresponding Pod’s access rights to restrict when the value can be output and to whom.

Other Helpful Documentation on Code Reference

Action Hook Reference

Field Functions

Field handling with Pods

Filter Reference

General Functions

Media Functions

Media handling functions in Pods

Pods Blocks API

Pods 2.8 introduces a new API for creating blocks with PHP.

Pods DFV JS API

The DFV JS API allows you to interact with the forms that Pods displays.

Pods REST API Endpoints

The Pods Admin REST API Endpoints for managing configurations.

Pods WP-CLI Commands

How to use the Pods CLI to access wp pods and wp pods api

pods_api()

We are working hard on our new code reference site. Until then this section will remain unavailable. Thank you for your patience.

pods_ui()

Easily create content admin screens with in-depth customization.

pods()

Set up the Pods class object for a specific pod.

Registering Configurations

Registering Configurations with Pods is possible through file-based or code-based registration.

WPGraphQL Integration

The WPGraphQL integration allows Pods content types and their fields to be discoverable by the WPGraphQL plugin.