Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 30264b0

Browse files
authored
Merge pull request #106 from prtksxna/get_linkbacks
get_linkbacks: add $order param to order retrieved comments
2 parents f5f9b58 + cc518c4 commit 30264b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

includes/functions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ function get_linkbacks_number( $type = null, $post_id = 0 ) {
3434
*
3535
* @param string $type the comment type
3636
* @param int $post_id the id of the post
37+
* @param string $order the order of the retrieved comments, ASC or DESC (default)
3738
*
3839
* @return the matching linkback "comments"
3940
*/
40-
function get_linkbacks( $type = null, $post_id = 0 ) {
41+
function get_linkbacks( $type = null, $post_id = 0, $order = 'DESC' ) {
4142
$args = array(
4243
'post_id' => $post_id,
4344
'status' => 'approve',
45+
'order' => $order,
4446
);
4547

4648
if ( $type ) { // use type if set

0 commit comments

Comments
 (0)