wp-includes/interactivity-api/class-wp-interactivity-api.php:931Parse 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 ): array { $directive_attributes = $p->get_attribute_names_with_prefix( 'data-wp-' . $prefix ); if ( null === $directive_attributes ) { return array(); } $entries = array(); foreach ( $directive_attributes as $attribute_name ) { $parsed_directive = $this->parse_directive_name( $attribute_name ); if ( null === $parsed_directive ) { continue; } [ 'prefix' => $attr_prefix, 'suffix' => $suffix, 'unique_id' => $unique_id ] = $parsed_directive; // Ensure it is the desired directive. if ( $prefix !== $attr_prefix ) { continue; } $attribute_value = $p->get_attribute( $attribute_name ); if ( null === $attribute_value ) { continue; } /* * The namespace stack can hold false, which data_wp_interactive_processor() pushes for a * `data-wp-interactive` whose namespace is invalid and which has no enclosing one to inherit. Only a * string names a store, so anything else counts as no default namespace at all. */ $default_namespace = array_last( $this->namespace_stack ?? array() ); if ( ! is_string( $default_namespace ) ) { $default_namespace = null; } list( $namespace, $value ) = $this->extract_directive_value( $attribute_value, $default_namespace ); $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.