protected function setup_options_slug( $options ) {
		$slug = $options->slug;

		// When `slug` is false or not required a unique slug should be generated.
		if ( $slug === false || ( empty( $slug ) && $this->slug_required === false ) ) {
			return '_' . papi_html_name( md5( uniqid( rand(), true ) ) );
		}

		// If `slug` is empty, check if `title` is not empty
		// and generate a slug from the `title` or if empty
		// use the `type`.
		if ( empty( $slug ) ) {
			if ( empty( $options->title ) ) {
				$slug = papi_slugify( $options->type );
			} else {
				$slug = papi_slugify( $options->title );
			}
		}

		// Create a html friendly name from the `slug`.
		return papi_html_name( $slug );
	}