Indicates if the current node is of a given type or name.
Description
It's possible to pass either a node type or a node name to this function.In the case there is no current element it will always return false. Example: // Is the current node a text node?
$stack->current_node_is( '#text' );
// Is the current node a DIV element?
$stack->current_node_is( 'DIV' );
// Is the current node any element/tag?
$stack->current_node_is( '#tag' );
Parameters
$identitystring
Check if the current node has this name or type (depending on what is provided).
Return
bool
Whether there is a current element that matches the given identity, whether a token name or type.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/html-api/class-wp-html-open-elements.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.