ACF Card
Please make sure you've the latest plugin version before using these filters.
Some filters are common and available in both versions, but some are available only in our Pro version. They are prefixed as "(Pro)".
Do you want to customize, but some filter is missing? Contact us and we'll add it as soon as possible.
Allows to customize WP_Query arguments that are used to get posts for an ACF Card.
add_filter('acf_views/card/query_args', function ($args, $cardId, $pageNumber) {
// any modifications to the $args here
return $args;
}, 10, 3);
$cardId
(int) ID of the current ACF Card$pageNumber
(int) Current page number. By default 1, has another number only within the AJAX pagination.
Allows to add custom variables to the custom markup.
add_filter('acf_views/card/custom_variables', function ($customVariables, $cardId) {
// any modifications to the $customVariables here
return $customVariables;
}, 10, 2);
$customVariables
(array) An associative array of values, where keys are variable names. These variables can be accessed in the custom markup with brackets, like{VARIABLE_NAME}
$cardId
(int) ID of the current ACF Card
It’s a built-in WordPress hook that allows modifying the output of the whole shortcode. Code example shown below. Read more here.
add_filter('do_shortcode_tag', function ($output, $tag, $attr) {
if ('acf_cards' != $tag) {
return $output;
}
// todo my custom changes for $output
return $output;
}, 10, 3);
Last modified 19d ago