Recent

ata_get_snippets_by_location filter

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

TypeNameDescription
\WP_Post[]|int[]$snippetsArray of snippet objects or snippet IDs on success or false on failure.
string$locationLocation of the snippet. Valid options are header, footer, content_before and content_after.
int$numberpostsOptional. Number of snippets to retrieve. Default is -1.

Usage

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