Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: _wp_post_revision_field_{$field}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 3 times in this file.

Line Code
163           <span class="alignright"><?php printf( __('Newer: %s'), wp_post_revision_title( $right_revision ) ); ?></span>
164      </th>
165 </tr>
166 <?php endif;
167
168 // use get_post_to_edit filters?
169 $identical = true;
170 foreach ( _wp_post_revision_fields() as $field => $field_title ) :
171      if ( 'diff' == $action ) {
172           $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field );
173           $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field );
174           if ( !$content = wp_text_diff( $left_content, $right_content ) )
175                continue; // There is no difference between left and right
176           $identical = false;
177      } else {
178           add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );
179           $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field );
180      }
181      ?>
182
183      <tr id="revision-field-<?php echo $field; ?>">
184           <th scope="row"><?php echo esc_html( $field_title ); ?></th>
185           <td><div class="pre"><?php echo $content; ?></div></td>
186      </tr>
187
188      <?php