Custom Fields Compare

Description

This filter allows you to display custom field comparison during revision of the post.

Usage

add_filter('owf_display_custom_fields', 'compare_custom_fields', 10, 2 );

Parameters

  • $original_post_id – Id of original post.
  • $revision_post_id – Id of the revised post.

Example

add_action( 'owf_display_custom_fields',  'compare_custom_fields' , 10, 2 ); 

function compare_custom_fields ( $original_post_id, $revision_post_id ) {
      $original_post_data = get_post( $original_post_id );
      $revision_post_data = get_post( $revision_post_id );
      $args = array(
         'title' => 'Differences',
         'title_left' => 'Old Content',
         'title_right' => 'New Content'
      );
      $difference = wp_text_diff( $original_post_data, $post_content, $revision_post_data->post_content, $args );
      echo $difference;
}

Source Code

The filter is located oasis-workflow-pro/includes/pages/revision-compare.php

Didn't find what you are looking for? Submit a Query

Unset PostmetaPast Publish Date