pods_group_add

Add a meta group of fields to add/edit forms

Add a meta group of fields to add/edit forms

Function Definition

function pods_group_add ( $pod, $label, $fields, $context = 'normal', $priority = 'default', $type = null )

Source File: /pods/includes/general.php

Parameters

PARAMETER TYPE DETAILS
$pod (string|array) The pod or type of element to attach the group to.
$label (string) Title of the edit screen section, visible to user.
$fields (string|array) Either a comma separated list of text fields or an associative array containing field information.
$context (string) (optional) The part of the page where the edit screen section should be shown (‘normal’, ‘advanced’, or ‘side’).
$priority (string) (optional) The priority within the context where the boxes should show (‘high’, ‘core’, ‘default’ or ‘low’).
$type (string) (optional) Type of the post to attach to.

Returns

(void)

Examples

<?php 
/** 
* Add my metaboxes for the Books pod 
* 
* $type (string)  
*   The type of object (post_type, taxonomy, media, user, or comment) 
* 
* $name (string) 
*   The name of the object (pod name, post type, taxonomy name,  
*   media, user, or comment) 
*/ 
function my_metaboxes ( $type, $name ) { 
        // Add a new meta group for the Books post type 
    pods_group_add( 'books', 'Book Information', 'preface,isbn' ); 

        // Add a new shared meta group to the Books and Other Books post types 
    pods_group_add( array( 'books', 'other_books' ), 'Book Information', 'preface,isbn' ); 
} 

// Hook into Pods Metaboxes 
add_action( 'pods_meta_groups', 'my_metaboxes', 10, 2 );

 

See Also

Other Helplful Documentation on Code Reference or go back to General Functions

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.