Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/17/2022 08:04:32 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Moderation: use the correct post_status when untrashing a topic/reply.

This change fixes a bug/regression (since WordPress 5.6.0) that was causing untrashed topics & replies to use an unintended post_status value.

It fixes it by adding a new function ('bbp_fix_untrash_post_status()') and hooking it to the wp_untrash_post_status filter in WordPress, and overriding the results as needed.

Props r-a-y.

In branches/2.6 for 2.6.10. Fixes #3433.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/core/filters.php

    r7124 r7234  
    5252// Fix post author id for anonymous posts (set it back to 0) when the post status is changed
    5353add_filter( 'wp_insert_post_data', 'bbp_fix_post_author', 30, 2 );
     54
     55// Fix untrash post status after a topic or reply is re-instated
     56add_filter( 'wp_untrash_post_status', 'bbp_fix_untrash_post_status', 10, 3 );
    5457
    5558// Force comments_status on bbPress post types
Note: See TracChangeset for help on using the changeset viewer.