WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 3 times in this file.
| Line | Code |
|---|---|
| 166 | * htmlspecialchars. Use this filter to remove or change the processing. Passes a context |
| 167 | * indicating if the line is added, deleted or unchanged. |
| 168 | * |
| 169 | * @since 4.1.0 |
| 170 | * |
| 171 | * @param string $processed_line The processed diffed line. |
| 172 | * @param string $line The unprocessed diffed line. |
| 173 | * @param string $context The line context. Values are 'added', 'deleted' or 'unchanged'. |
| 174 | */ |
| 175 | $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'added' ); |
| 176 | } |
| 177 | |
| 178 | if ( $this->_show_split_view ) { |
| 179 | $r .= '<tr>' . $this->emptyLine() . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n"; |
| 180 | } else { |
| 181 | $r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n"; |
| 182 | } |
| 183 | } |
| 184 | return $r; |
| Line | Code |
| 192 | * @return string |
| 193 | */ |
| 194 | public function _deleted( $lines, $encode = true ) { |
| 195 | $r = ''; |
| 196 | foreach ( $lines as $line ) { |
| 197 | if ( $encode ) { |
| 198 | $processed_line = htmlspecialchars( $line ); |
| 199 | |
| 200 | /** This filter is documented in wp-includes/wp-diff.php */ |
| 201 | $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'deleted' ); |
| 202 | } |
| 203 | if ( $this->_show_split_view ) { |
| 204 | $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() . "</tr>\n"; |
| 205 | } else { |
| 206 | $r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n"; |
| 207 | } |
| 208 | } |
| 209 | return $r; |
| 210 | } |
| Line | Code |
| 217 | * @return string |
| 218 | */ |
| 219 | public function _context( $lines, $encode = true ) { |
| 220 | $r = ''; |
| 221 | foreach ( $lines as $line ) { |
| 222 | if ( $encode ) { |
| 223 | $processed_line = htmlspecialchars( $line ); |
| 224 | |
| 225 | /** This filter is documented in wp-includes/wp-diff.php */ |
| 226 | $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'unchanged' ); |
| 227 | } |
| 228 | if ( $this->_show_split_view ) { |
| 229 | $r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line ) . "</tr>\n"; |
| 230 | } else { |
| 231 | $r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n"; |
| 232 | } |
| 233 | } |
| 234 | return $r; |
| 235 | } |