WP_HTML_Tag_Processor::get_enqueued_attribute_value( string $comparable_name ): string|boolean|null

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Return the enqueued value for a given attribute, if one exists.

Description

Enqueued updates can take different data types:

  • If an update is enqueued and is boolean, the return will be true
  • If an update is otherwise enqueued, the return will be the string value of that update.
  • If an attribute is enqueued to be removed, the return will be null to indicate that.
  • If no updates are enqueued, the return will be false to differentiate from “removed.”

Parameters

$comparable_namestringrequired
The attribute name in its comparable form.

Return

string|boolean|null Value of enqueued update if present, otherwise false.

Source

	}

	$this->lexical_updates = array();

	return $accumulated_shift_for_given_point;
}

/**
 * Checks whether a bookmark with the given name exists.
 *
 * @since 6.3.0
 *
 * @param string $bookmark_name Name to identify a bookmark that potentially exists.
 * @return bool Whether that bookmark exists.
 */
public function has_bookmark( $bookmark_name ): bool {
	return array_key_exists( $bookmark_name, $this->bookmarks );
}

/**
 * Move the internal cursor in the Tag Processor to a given bookmark's location.
 *
 * In order to prevent accidental infinite loops, there's a
 * maximum limit on the number of times seek() can be called.
 *
 * @since 6.2.0
 *
 * @param string $bookmark_name Jump to the place in the document identified by this bookmark name.
 * @return bool Whether the internal cursor was successfully moved to the bookmark's location.
 */
public function seek( $bookmark_name ): bool {
	if ( ! array_key_exists( $bookmark_name, $this->bookmarks ) ) {
		_doing_it_wrong(
			__METHOD__,
			__( 'Unknown bookmark name.' ),
			'6.2.0'
		);
		return false;
	}

	$existing_bookmark = $this->bookmarks[ $bookmark_name ];

	if (
		$this->token_starts_at === $existing_bookmark->start &&
		$this->token_length === $existing_bookmark->length
	) {
		return true;
	}

	if ( ++$this->seek_count > static::MAX_SEEK_OPS ) {
		_doing_it_wrong(

Changelog

VersionDescription
6.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.