Skip to content

How to modify capabilities shown in the field "Only visible to..." dropdown

Zack Katz edited this page May 14, 2014 · 1 revision

GravityView only shows a few roles by default. If you want to add more, here's how:

add_filter( 'gravityview_field_visibility_caps', 'modify_gravityview_field_visibility_caps');

function modify_gravityview_field_visibility_caps($caps) {

	// Add your capabilities here.
	$caps[] = array(
		'label' => 'Edit Dashboard',
		'value' => 'edit_dashboard'
	);

	return $caps;
}
Clone this wiki locally