Since: 2.0
pods_group_add
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
Example 1
<?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 );