Skip to content

Instantly share code, notes, and snippets.

@the-sufi
Last active June 17, 2020 23:13
Show Gist options
  • Save the-sufi/9bd31fff253843c512bd465c0f198953 to your computer and use it in GitHub Desktop.
Save the-sufi/9bd31fff253843c512bd465c0f198953 to your computer and use it in GitHub Desktop.
WHMCS Client Area Ticket View - Show Oldest Reply First
<?php
/**
* code goes inside "includes/hooks" directory
*/
/**
* Client Area Ticket View - Show Oldest Reply First
* @param $vars
* @return array
*/
function dctit_clientarea_view_ticket_sort($vars) {
//by default Six template is using $descreplies variable to show tickets/replies in client area.
//this shows latest reply first. it returns the value of $vars['descreplies'].
//to show oldest reply first, $descreplies is replaced with $vars['ascreplies']
return array ( 'descreplies' => $vars['ascreplies'] );
}
add_hook("ClientAreaPageViewTicket", 1, "dctit_clientarea_view_ticket_sort");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment