Forum Replies Created
-
In reply to: Pagination after deleting posts
I’m sorry , it does not indeed.
Edit: I’m sorry, I now understand the 3 and the 10 are add_filter inputs to set priority and number of arguments…
Your code works, thanks a lot. I have been to fast in my replies without proper testing.
In reply to: Pagination after deleting postsI have been looking at the function more closely, and think the correct code is as follows:
add_filter ('bbp_get_reply_position' , 'rew_redo_reply_position') ; function rew_redo_reply_position ($reply_id=0, $topic_id=0) { // Get required data $reply_id = bbp_get_reply_id( $reply_id ); // Get topic ID $topic_id = ! empty( $topic_id ) ? bbp_get_topic_id( $topic_id ) : bbp_get_reply_topic_id( $reply_id ); // Post is not the topic if ( $reply_id !== $topic_id ) { $reply_position = bbp_get_reply_position_raw( $reply_id, $topic_id ); // Update the reply position in the posts table so we'll never have // to hit the DB again. if ( ! empty( $reply_position ) ) { bbp_update_reply_position( $reply_id, $reply_position ); } // Topic's position is always 0 } else { $reply_position = 0; } // Bump the position by one if the topic is included in the reply loop if ( ! bbp_show_lead_topic() ) { $reply_position++; } // Filter & return return (int) apply_filters( 'rew_redo_reply_position', $reply_id, $topic_id ); }
In reply to: Pagination after deleting postsI assume this ‘3’ and ’10’ should not be in there and the function should be defined like function rew_redo_reply_position ($reply_position, $reply_id=0, $topic_id=0) ?
In that case, the link to new pages does not work at all: /page/2 is not generated anymore and the link becomes /#post-id , which does not exist anymore on the first page since it is on page 2…
In reply to: Pagination after deleting postsNo, it occurs also when viewing all topics on the main page of a forum: within the link to the latest reply.
Every link that links directly to a specific reply on a certain topic has this issue.In reply to: Pagination after deleting postsThat does not fix the problem, it does not affect menu_order.
In reply to: Pagination after deleting postsI think the problem is in het menu_order property within the posts table in the database, which is not updated for posts after the deleted posts.
bbp_get_reply_position() within bbp_get_reply_url() is using this menu_order property. The result determines the page a post should be on, which is therefore wrong when posts have been deleted and other post’s ‘menu_order’ is in fact too high.
In reply to: Custom bbpress.cssDoes anyone have an idea on how to fix this problem?