- This topic has 2 replies, 2 voices, and was last updated 5 years, 1 month ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › WordPress Plugins › Changing the order of forums in the digest
Hi 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
Hi 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
, where q
is the alias to bbpnns_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
Sorry, I missed this. Been ill! Thanks for this, Vinny.
© UseStrict Consulting - All rights reserved