WP_HTML_Processor::bookmark_token()privateWP 6.4.0

Creates a new bookmark for the currently-matched token and returns the generated name.

Method of the class: WP_HTML_Processor{}

No Hooks.

Return

String|false. Name of created bookmark, or false if unable to create.

Usage

// private - for code of main (parent) class only
$result = $this->bookmark_token();

Changelog

Since 6.4.0 Introduced.
Since 6.5.0 Renamed from bookmark_tag() to bookmark_token().

WP_HTML_Processor::bookmark_token() code WP 6.6.2

private function bookmark_token() {
	if ( ! parent::set_bookmark( ++$this->bookmark_counter ) ) {
		$this->last_error = self::ERROR_EXCEEDED_MAX_BOOKMARKS;
		throw new Exception( 'could not allocate bookmark' );
	}

	return "{$this->bookmark_counter}";
}