Thanks, Michael.
Basic test code follows. In this example I tried basically all options on both places I could think to try them. I’m tried reading through the source to see if this was even possible but TBH, got a little (ok, a lot) lost.
My use case is: this group contains a set of fields with 4 different fields. I want to have some introductory text in a particular set of styles before the group starts. I found a way around that by including a “title” field which does support all of the before/after stuff. I’m also using CSS to cheat and make the group look like a separate set of meta boxes. Without before and after, that requires some fairly fragile CSS selectors instead of generic classes.
On this same note, it would be lovely if group fields also supported row_classes
.
$local_actions_group_field = $coa_cmb->add_field( array(
'id' => $prefix . 'local_conservation_actions_and_plans',
'type' => 'group',
'description' => __( 'Local Conservation Action or Plans', 'odfw' ),
'before_row' => '<p>Testing <b>"before_row"</b> parameter</p>',
'before' => '<p>Testing <b>"before"</b> parameter</p>',
'before_field' => '<p>Testing <b>"before_field"</b> parameter</p>',
'after_field' => '<p>Testing <b>"after_field"</b> parameter</p>',
'after' => '<p>Testing <b>"after"</b> parameter</p>',
'after_row' => '<p>Testing <b>"after_row"</b> parameter</p>',
'options' => array(
'group_title' => __( 'Action or Plan {#}', 'odfw' ),
'add_button' => __( 'Add another Local Conservation Action or Plan', 'odfw' ),
'remove_button' => __( 'Remove this entry', 'odfw' ),
'sortable' => true, // beta
'before_row' => '<p>Options Testing <b>"before_row"</b> parameter</p>',
'before' => '<p>Options Testing <b>"before"</b> parameter</p>',
'before_field' => '<p>Options Testing <b>"before_field"</b> parameter</p>',
'after_field' => '<p>Options Testing <b>"after_field"</b> parameter</p>',
'after' => '<p>Options Testing <b>"after"</b> parameter</p>',
'after_row' => '<p>Options Testing <b>"after_row"</b> parameter</p>',
)
));