Home › Forums › WordPress Plugins › Changing the order of forums in the digest
- This topic has 2 replies, 2 voices, and was last updated 4 years ago by
Jamie Furlong.
-
AuthorPosts
-
-
November 20, 2019 at 4:28 am #19719
Jamie Furlong
ParticipantHi Vinny,
I received my first proper weekly digest and the forums appear random. I can’t make sense of the order in which it decides to digest. I picked up on this because the first forum in the digest is ‘Troubleshooting’. This isn’t a good look, especially as this is the first digest my subscribers will have seen! Troubleshooting is not the first forum, and neither is it the lowest ID number, so can you tell me how the digest orders the forum topics and replies? Moreover, how can I change the order?
Cheers,
Jamie
-
November 22, 2019 at 7:09 pm #19881
vinny
KeymasterHi Jamie,
Sorry for the wait. As of Digests version 1.25, you can hook into the
bbpnns_queue_order_by
filter to change the order.The default order has also been set to
order by q.post_id, q.timestamp ASC
, whereq
is the alias tobbpnns_digest_queue
table.To change the order, do the following:
add_filter( 'bbpnns_queue_order_by', 'my_custom_digest_order', 10, 1 ); function my_custom_digest_order( $order_by ) { /** * Available fields are: * - q.notification_id * - q.user_id * - q.forum_id * - q.post_id * - q.post_type * - q.timestamp */ $order_by = 'order by q.post_id DESC'; // See http://www.mysqltutorial.org/mysql-order-by for examples. return $order_by; }
Cheers,
Vinny -
December 7, 2019 at 7:54 pm #21383
Jamie Furlong
ParticipantSorry, I missed this. Been ill! Thanks for this, Vinny.
-
-
AuthorPosts
- You must be logged in to reply to this topic.