Support

Account

Home Forums Backend Issues (wp-admin) Alter field group settings per content type Reply To: Alter field group settings per content type

  • Using $_GET to grab the post id worked great. Thanks so much.

    Here’s the final function:

    function toind_alter_flexible_content( $field_group ) {
    	if ( isset( $_GET['post'] ) ) {
    		$post_id   = intval( $_GET['post'] );
    		$post_type = get_post_type( $post_id );
    		if ( 'group_5c76d2e8213cf' === $field_group['key'] && 'event' === $post_type ) {
    			$field_group['menu_order'] = 7;
    			$field_group['position']   = 'normal';
    		}
    	}
    	return $field_group;
    }
    add_filter( 'acf/validate_field_group', 'toind_alter_flexible_content', 20 );
    

    Thank you again so much for all of your help.