wp-includes/interactivity-api/class-wp-interactivity-api.php:882Parse the HTML element and get all the valid directives with the given prefix.
$pWP_Interactivity_API_Directives_Processor$prefixstringarray private function get_directive_entries( WP_Interactivity_API_Directives_Processor $p, string $prefix ) { $directive_attributes = $p->get_attribute_names_with_prefix( 'data-wp-' . $prefix ); $entries = array(); foreach ( $directive_attributes as $attribute_name ) { [ 'prefix' => $attr_prefix, 'suffix' => $suffix, 'unique_id' => $unique_id] = $this->parse_directive_name( $attribute_name ); // Ensure it is the desired directive. if ( $prefix !== $attr_prefix ) { continue; } list( $namespace, $value ) = $this->extract_directive_value( $p->get_attribute( $attribute_name ), end( $this->namespace_stack ) ); $entries[] = array( 'namespace' => $namespace, 'value' => $value, 'suffix' => $suffix, 'unique_id' => $unique_id, ); } // Sort directive entries to ensure stable ordering with the client. // Put nulls first, then sort by suffix and finally by uniqueIds. usort( $entries, function ( $a, $b ) { $a_suffix = $a['suffix'] ?? ''; $b_suffix = $b['suffix'] ?? ''; if ( $a_suffix !== $b_suffix ) { return $a_suffix <=> $b_suffix; } $a_id = $a['unique_id'] ?? ''; $b_id = $b['unique_id'] ?? ''; return $a_id <=> $b_id; } ); return $entries; }Introduced in 6.9.0. Unchanged from 6.9.7 through 7.1.0.
Signature, return type and hooks compared across 3 parsed releases.
src/wp-includes/interactivity-api/class-wp-interactivity-api.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.