wppaste
WordPress

apply_filters( 'process_text_diff_html', string $processed_line, string $line, string $context )

Since
4.1.0
Contextually filters a diffed line.

Description

Filters TextDiff processing of diffed line. By default, diffs are processed with htmlspecialchars. Use this filter to remove or change the processing. Passes a context indicating if the line is added, deleted or unchanged.

Compatibility

WordPress
since 4.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$processed_linestring
The processed diffed line.
$linestring
The unprocessed diffed line.
$contextstring
The line context. Values are 'added', 'deleted' or 'unchanged'.

Where this hook fires · 3

  • wp-includes/class-wp-text-diff-renderer-table.php:213WP_Text_Diff_Renderer_Table::_added()
  • wp-includes/class-wp-text-diff-renderer-table.php:239WP_Text_Diff_Renderer_Table::_deleted()
  • wp-includes/class-wp-text-diff-renderer-table.php:264WP_Text_Diff_Renderer_Table::_context()

Source code

				 * @since 4.1.0				 *				 * @param string $processed_line The processed diffed line.				 * @param string $line           The unprocessed diffed line.				 * @param string $context        The line context. Values are 'added', 'deleted' or 'unchanged'.				 */				$line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'added' );			} 			if ( $this->_show_split_view ) {				$r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";			} else {				$r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n";

Changelog

Introduced in 4.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, 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.