private static function required_params_exist( $type, $data ) {

		$required = [ 'name', 'slug' ];

		if ( 'submenu' === $type ) {
			array_push( $required, 'parent' );
		}

		foreach ( $required as $field ) {
			if ( ! isset( $data[ $field ] ) || empty( $data[ $field ] ) ) {
				return false;
			}
		}

		return true;
	}