I ended up just doing it myself. Added a metabox that shows all content changes in Gutenberg, but now I’m noticing that approving changes on a revision draft clears ALL revision history for that post??
I guess I have to give up on this plugin. Poor support response for a paid plugin (I messaged over a month ago) and nothing seems to work for a real approval-and-audit-trail case. What a bummer.
Here’s my solution for displaying content changes (if they exist) in a metabox under the Gutenberg editor. Hopefully it helps someone else.
// ADD META BOX FOR CONTENT DIFFERENCES
function content_diff_meta_box() {
global $pagenow;
global $post;
$old_post_id = get_post_meta($post->ID, 'linked_post_id', true);
if ($pagenow === 'post.php' && $old_post_id) {
// We're reviewing a revision
$old_post_content = get_the_content(null, false, $old_post_id);
$new_post_content = $post->post_content;
$text_diff = wp_text_diff($old_post_content, $new_post_content);
if ($text_diff) {
// Differences exist
add_meta_box(
'content-diff',
'Content Updates',
'content_diff_meta_box_content',
null,
'normal',
'high',
array(
'text_diff' => $text_diff
)
);
}
}
}
add_action('add_meta_boxes', 'content_diff_meta_box');
// POPULATE METABOX WITH CONTENT DIFFERENCES
function content_diff_meta_box_content($post, $vars) {
$text_diff = $vars['args']['text_diff'] ?: null;
if (!$text_diff) {
// no content changes
echo "<style type='text/css'>
#content-diff {
display: none;
}
</style>";
}
else {
// content changes - show diff table
echo $text_diff;
echo "<style type='text/css'>
table.diff tbody tr td {
width: 50% !important;
}
</style>";
}
}
-
This reply was modified 3 years, 6 months ago by
martinparets.
-
This reply was modified 3 years, 6 months ago by
martinparets.
-
This reply was modified 3 years, 6 months ago by
martinparets.