コード例 #1
0
ファイル: history.php プロジェクト: adisonc/MaineLearning
					<td><div class="pre"><?php 
        echo bp_docs_history_post_revision_field(false, $field);
        ?>
</div></td>
				</tr>

			<?php 
    }
    ?>

		<?php 
}
?>

		<?php 
if ('diff' == bp_docs_history_action() && bp_docs_history_revisions_are_identical()) {
    ?>
			<tr><td colspan="2"><div class="updated"><p><?php 
    _e('These revisions are identical.', 'bp-docs');
    ?>
</p></div></td></tr>
		<?php 
}
?>

	</table>

	<br class="clear" />

	<?php 
bp_docs_list_post_revisions(get_the_ID());
コード例 #2
0
 /**
  * Determines whether left and right revisions are identical.
  *
  * This is cribbed nearly wholesale from wp-admin/revision.php. In the future I would like
  * to clean it up to be less WordPressy and more pluginish.
  *
  * @package BuddyPress Docs
  * @since 1.1
  */
 function setup_is_identical()
 {
     $this->revisions_are_identical = true;
     foreach (_wp_post_revision_fields() as $field => $field_title) {
         if ('diff' == bp_docs_history_action()) {
             $left_content = apply_filters("_wp_post_revision_field_{$field}", $this->left_revision->{$field}, $field);
             $right_content = apply_filters("_wp_post_revision_field_{$field}", $this->right_revision->{$field}, $field);
             if (!($content = wp_text_diff($left_content, $right_content))) {
                 continue;
             }
             // There is no difference between left and right
             $this->revisions_are_identical = false;
         } else {
             if (isset($this->revision) && is_object($this->revision) && isset($this->revision->{$field})) {
                 add_filter("_wp_post_revision_field_{$field}", 'htmlspecialchars');
                 $content = apply_filters("_wp_post_revision_field_{$field}", $this->revision->{$field}, $field);
             }
         }
     }
 }