WP_Text_Diff_Renderer_Table::_added()
Method of the class: WP_Text_Diff_Renderer_Table{}
Hooks from the method
Return
String
.
Usage
$WP_Text_Diff_Renderer_Table = new WP_Text_Diff_Renderer_Table(); $WP_Text_Diff_Renderer_Table->_added( $lines, $encode );
- $lines(array) (required)
- -
- $encode(true|false)
- -
Default: true
WP_Text_Diff_Renderer_Table::_added() WP Text Diff Renderer Table:: added code WP 6.5.2
public function _added( $lines, $encode = true ) { $r = ''; foreach ( $lines as $line ) { if ( $encode ) { $processed_line = htmlspecialchars( $line ); /** * Contextually filters a diffed line. * * 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. * * @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"; } } return $r; }