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