acf_get_field_group_edit_link()ACF 5.7.7

acf_get_field_group_edit_link

Checks if the current user can edit the field group and returns the edit url.

No Hooks.

Returns

String.

Usage

acf_get_field_group_edit_link( $post_id );
$post_id(int) (required)
The field group ID.

Changelog

Since 5.7.7 Introduced.

acf_get_field_group_edit_link() code ACF 6.0.4

function acf_get_field_group_edit_link( $post_id ) {
	if ( $post_id && acf_current_user_can_admin() ) {
		return admin_url( 'post.php?post=' . $post_id . '&action=edit' );
	}
	return '';
}