Currently banging my head on this error:
Notice: Undefined variable: diffs in /path/wp-content/plugins/post-revision-display/post-revision-display.php on line 232 Notice: Undefined variable: rev_content in /path/wp-content/plugins/post-revision-display/post-revision-display.php on line 233
Here are the lines in question (with some extra for context):
// question: should we be applying filters to all the parts and not just content?
function prd_set_globals() {
if (!$post = get_post(get_the_ID())) {
return;
}
$revision = null;
$rev_id = 0;
$is_rev = false;
$note = prd_get_revision_note($post, $revision, $rev_id, $is_rev);
if ($is_rev) {
$diffs = prd_get_revision_diffs($post, $revision);
/* seems clunky, but I don't know a better way -- want to apply_filters
for old revision, but need to skip prd_display_post_revisions filter
to avoid getting stuck in a loop, so will remove filter and add
right back in */
remove_filter('the_content', 'prd_display_post_revisions');
$rev_content = apply_filters('the_content', $revision->post_content);
add_filter('the_content', 'prd_display_post_revisions');
}
$revs = prd_get_revision_list($post, array('since_publish' => true, 'type' => 'revision',
'rev_id' => $rev_id, 'is_rev' => $is_rev));
$GLOBALS['prd_is_rev'] = $is_rev;
$GLOBALS['prd_revision_note'] = $note;
$GLOBALS['prd_revision_list'] = $revs;
$GLOBALS['prd_revision_diffs'] = $diffs;
$GLOBALS['prd_revision_content'] = $rev_content;
$GLOBALS['prd_globals_set'] = true;
}
I’m using Manual Mode. And have this in the template file in use:
if ( $prd == "on" && function_exists('the_revision_note_prd')) {
the_revision_note_prd();
}
the_content();
if ( $prd == "on" ) {
if(function_exists('the_revision_list_prd')) { the_revision_list_prd(true); }
if(function_exists('the_revision_diffs_prd')) { the_revision_diffs_prd(); }
}
The error shows up above the content, and then again below the content. However, despite the error, the revision list still displays and functions as I’d expect. Clicking a revision link takes one to the revision page… complete w/ note at the top. Yet no error messages on past revision pages. Only on ‘current’.