Skip to:
Content
Pages
Categories
Search
Top
Bottom

Too many "revision" statements – How to remove all but 1


  • dubbinz
    Participant

    @dubbinz

    I’ve noticed the revision statements are listing all revisions.

    “This topic was modified 2 months, 1 week ago by Ovyda”

    statements like this build up and looks really messy.

    I want to know how to remove all statements and only show the last time it was edited. (yes I know users can uncheck the option to not show revision)

    Any help would be appreciated.

Viewing 18 replies - 1 through 18 (of 18 total)

  • DarioZ
    Participant

    @darioz

    Also I would like to know if there is a way to show only the latest…

    There is a Ticket somewhere in our bug tracking for bbPress, I just can’t find it right now but there is a planned improvement to only show a single revision log notice, it is planned to do a bit more than just the notice display also 😉


    coskel22
    Participant

    @coskel22

    is there any way to remove it without waiting for a bbpress upgrade?


    PinkishHue
    Participant

    @pinkishhue

    Any update on this? Or any suggestions?

    If no replies I will dive in the code to try and figure it out. Just trying to save time, hopefully someone has already done this or has a general idea how to (even a suggestion on the file to edit would save me a step!)

    Thank you 🙂

    The ticket is https://bbpress.trac.wordpress.org/ticket/1989, there are some specific things we want to do with revisions, we want to actually keep all revisions but only display one revision, we want to be able to “scroll through” the list of revisions, you can see an example of this in the following comment https://bbpress.trac.wordpress.org/ticket/1989#comment:19, in that comment you’ll see previous and diff, once you click previous you’ll then see next.

    If you want to join our development chat we can chat about what and where further.

    To join follow the instructions here and join the #bbpress channel 🙂
    http://chat.wordpress.org


    PinkishHue
    Participant

    @pinkishhue

    Thanks Stephen 🙂

    Will definitely keep an eye on developments. For now I have used CSS to hide all but the most recent revision, here’s the code if anyone else needs it:

    .bbp-topic-revision-log li {
    	display:none;
    }
    .bbp-topic-revision-log li:last-child {
    	display:block;
    }

    TallSam
    Participant

    @tallsam

    I’m having this problem so I guess it isn’t fixed yet?

    I tried the adding the CSS that PinkishHue posted but it didn’t help.

    Any suggestions?

    Thanks,
    Sam


    Robkk
    Moderator

    @robkk

    @tallsam Its not really an issue since it should show a list of items in the latest version of bbPress and since Stephen’s ticket he linked to has not been committed yet.

    IF @pinkishhue’s Custom CSS code does not work after you placed it in your child themes style.css file and have also tried adding !important on the end, you can try my custom php code snippet.

    Make sure to place this into your child themes functions.php file in your child theme.

    // 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 );

    TallSam
    Participant

    @tallsam

    That crashed my sight for some reason. Any thoughts?

    !important didn’t help either…

    Thanks,
    Sam

    My question: do you really want those revisions ?
    I delete them regularly using https://wordpress.org/plugins/rvg-optimize-database/

    Pascal.


    TallSam
    Participant

    @tallsam

    Is there a way to manually delete them, without another plugin? (getting to be too many plugins for my site…)

    Well, if you have a good backup of your database, you can always launch this query:
    DELETE FROM wp_posts WHERE post_type = "revision";
    Pascal.


    TallSam
    Participant

    @tallsam

    I don’t like the sounds of that… I think I would rather try the plugin you mentioned.

    But first, is there going to be an update to bbpress that will remove the extra revision statements? If so, any thoughts on when this will be ready?

    Thanks,
    Sam


    Robkk
    Moderator

    @robkk

    That crashed my sight for some reason. Any thoughts?


    @tallsam

    Did you place the code snippet I placed earlier correctly?? It seems to work fine on my test site.

    Same thing goes for @pinkishhue‘s code.

    These both work if you want to show only 1 revision log on the Frontend of your forums.

    But first, is there going to be an update to bbpress that will remove the extra revision statements? If so, any thoughts on when this will be ready?

    Not really remove the statements, but just make 1 visible. Have no idea when @netweb’s code will make it into core.


    @tallsam

    Do you want them all gone?? This topic is all about just having one visible on the frontend.

    Also there might be a bug about the revisions somewhere I think. Haven’t fully checked that one out though.

    But you can always disable the revision logging from being displayed in the forums in Settings > Forums, there will still be revisions on the edits in the backend though, since it is a post type in WordPress. And hide the existing revisions with CSS using the first half of pinkishhue’s code.

    There is a way to limit the total number of revisions kept per post though in WordPress.

    But if you do want to completely remove the revisions you can use a plugin that @casiepa listed, but this may remove ALL revisions of any post or plugin using the revision system in WordPress. Some custom css plugins may use it, and clearing the revisions may lose all your saved styles.


    TallSam
    Participant

    @tallsam

    I turned off revision logging and that did the trick, thanks!

    Sam


    Robkk
    Moderator

    @robkk

    no problem 🙂


    tech55541
    Participant

    @tech55541

    Thanks @robkk, that code in functions.php did the trick.


    alexanderbiscajin
    Participant

    @alexanderbiscajin

    Disable post

    I think that would be helpful to solve your query https://www.wpblog.com/disable-limit-wordpress-post-revisions/

Viewing 18 replies - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.
Skip to toolbar