Developer Resources

A comprehensive list of filters and actions included in our plugin

Hooks / nab_pre_get_posts

apply_filters( ‘nab_pre_get_posts’, null|array $data, string $post_type, string $query, int $per_page, int $page )

Filters the post before the actual query is run.

Parameters

$data null|array

(Required) The result data. Form the array like this: $data = array( 'results' => array( 'id' => string|int, 'title' => string, 'excerpt' => string, 'date' => string, 'imageId' => int, 'imageSrc' => string, 'thumbnailSrc' => string, 'type' => string, 'typeLabel' => string, 'status' => string, 'statusLabel' => string, 'link' => string, ), 'pagination': array( 'more': bool, 'pages': int, ) );

$post_type string

(Required) The post type.

$query string

(Required) The query term.

$per_page int

(Required) The number of posts to show per page.

$page int

(Required) The number of the current page.