Skip to content
bonsak edited this page Nov 20, 2012 · 1 revision

#pods_group_add() This function adds metaboxes to a Pod's content admin form. It can be used to create new metaboxes for post types not controlled by Pods too.

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

#Parameters

Parameter Type Details
$pod string or 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 or 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.

###Example

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

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

###Available Since Version

2.0+

###See Also