Skip to:
Content
Pages
Categories
Search
Top
Bottom

Revision logs notes code?


  • tkse
    Participant

    @tkse

    I’m looking to limit the “Edited by xxxx” to the last edit at the end of every post. I remember looking through the forum on the topic, and I found it suggested to another user to use WordPress’ own the_author and the_modified_time. This should work great, however, how do I include the revision notes from the last edit? In other words the reason a user adds for editing their post.

Viewing 1 replies (of 1 total)

  • Robkk
    Moderator

    @robkk

    Are you just using the_author and the_modified_time to just display 1 revision log. You can use the default revision logs and then use a function or some CSS to display 1 revision log instead.

    PHP functiion, place in your child themes functions.php file or in a functionality plugin.

    // Only return one entry for revision log otherwise it gets cluttered
    function bbp_trim_revision_log( $r='' ) {
     $arr = array( end( $r ));
     reset( $r );
     
     return( $arr );
    }
     
    add_filter( 'bbp_get_reply_revisions', 'bbp_trim_revision_log', 20, 1 );
    add_filter( 'bbp_get_topic_revisions', 'bbp_trim_revision_log', 20, 1 );

    CSS snippet, place in your child themes style css or in anywhere else you can place custom css snippets like a custom css plugin.

    .bbp-topic-revision-log li {
    	display:none;
    }
    .bbp-topic-revision-log li:last-child {
    	display:block;
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar