Recent

ata_get_snippets_by_locationfilter

ata_get_snippets_by_location

Retrieves the snippet data given a snippet ID or object.

Type: filter
Since: 2.0.0
Source: includes/snippets/class-functions.php line 244

Parameters

Type Name Description
\WP_Post[]|int[] $snippets Array of snippet objects or snippet IDs on success or false on failure.
string $location Location of the snippet. Valid options are header, footer, content_before and content_after.
int $numberposts Optional. Number of snippets to retrieve. Default is -1.

Usage

add_filter( 'ata_get_snippets_by_location', function($snippets, $location, $numberposts) {
    // ...
    return $snippets;
} );