sorry, can you explain what you mean by clicking on “Recycle Bin”? Is this front end/backend or where are you seeing this?
Hi Robin,
it’s in the frontend. In the head of the posts there is a button “Papierkorb” (recycle bin).
I check if the topic is listed in the wordpress-backend after clicking on the Recycle bin in the frontend. And there it is also removed.
ok, so the first click of ‘trash’ should not delete the topic, but place it in the trash. You should then see ‘delete’ and ‘restore’ on the front end.
Is this is not what you are seeing?
You can also see the topic in the backend in the ‘trash’ selection
Yes, when I click on trash the topic is pushed to the trash section in the backend. BUT it is not possible to restore a topic or a post by clicking “restore” in the frontend. After clicking on “restore” there is a redirect to a textarea-input. But it is not possible to see the restored topic or the restored posts. And in the overview of the forum the topic which is pushed to the trash bin is not displayed.
I use the moderator role in the forum and the moderator should not have access to the backend. So restoring topics in the backend is no option for me.
I also check this with an other theme (Twenty-Twenty-one), but it did not change the problem.
So the situation is not very satisfying.
And after clicking on “delete” in the frontend, which should delete the topic finally from the database, the “deleted” topic is shown in the overview of the forum. After reloading the page, the deleted topics are disappeared.
In my last post there is a wrong information. After clicking on delete in the frontend, the page with the forum overview reloads and shows topics which are pushed to trash. Curiously not all topics from “trash” are displayed in the frontend. It looks absolutly random. And its absolutly not possible to change the status of the “trashed” topic in the frontend.
I also deactivate some plugins which extends the bbpress plugin. But that takes also no effect.
Does anyone have an idea?
I’ve just taken a look at the front end restore.
The bbpress restore function calls a wordpress function wp_untrash_post
which sets the restored status to ‘draft’.
I’m pretty sure that it didn’t used to do that, so am presuming it’s a wordpress change.
However if you are using
bbp style pack
then I’ve added a fix for this to the ‘bbpress bug fixes’ tab.
If you want code, then put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
add_filter ('wp_untrash_post_status', 'rew_correct_untrash_status' , 10, 3) ;
function rew_correct_untrash_status ($new_status, $post_id, $previous_status) {
$post_check = get_post( $post_id );
//update_post_meta ($post_id , 'rew_type', $post_check->post_type) ;
//if it's a reply or topic, then change status back to $previous_status
if ($post_check->post_type == bbp_get_reply_post_type() || $post_check->post_type == bbp_get_topic_post_type()) {
$new_status = $previous_status ;
}
return $new_status ;
}
Hi Robin,
thank you very much for the code snippet! I add this to the functions.php of the child theme and it works.
Yesterday I detect an other strange behavior. If I click on “reply” in the frontend on the first post of a topic, the page also reloads and the reply will not be nested under the replied post. Clicking twice set a relation to the replied post and set it as a nested post.
Do you have an idea how I can solve this?
Kind regards
Marco
try
bbp style pack
once activated go to
dashboard>settings>bbp style pack>bug fixes
Fix Threaded Replies Jump
Hi Robin,
thank you very much.
Currently it is not possible to make a nested reply on the first post of the topic. Only at the second post the nested reply works. I think that is not a concept of bbpress and has to do with the last wordpress update?
Kind regards
I posted a ticket about this here: https://bbpress.trac.wordpress.org/ticket/3433
It’s an issue since WordPress 5.6.0.