# gutenberg/16.6.0/lib/experimental/interactivity-api/directives/wp-text.php

Gutenberg, version 16.6.0. 28 lines.

- Page: https://pluginprobe.com/plugins/gutenberg/16.6.0/code/lib/experimental/interactivity-api/directives/wp-text.php
- Raw: https://pluginprobe.com/plugins/gutenberg/16.6.0/raw/lib/experimental/interactivity-api/directives/wp-text.php
- Modified: 2023-07-12T17:34:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/gutenberg/16.6.0/code/lib/experimental/interactivity-api/directives/wp-text.php#L10-L20`.

```php
<?php
/**
 * Process wp-text directive attribute.
 *
 * @package Gutenberg
 * @subpackage Interactivity API
 */

/**
 * Process wp-text directive attribute.
 *
 * @param WP_Directive_Processor $tags Tags.
 * @param WP_Directive_Context   $context Directive context.
 */
function gutenberg_interactivity_process_wp_text( $tags, $context ) {
	if ( $tags->is_tag_closer() ) {
		return;
	}

	$value = $tags->get_attribute( 'data-wp-text' );
	if ( null === $value ) {
		return;
	}

	$text = gutenberg_interactivity_evaluate_reference( $value, $context->get_context() );
	$tags->set_inner_html( esc_html( $text ) );
}

```
