Skip to content

Can't add anything to flynt's functions.php (flynt 2.1.1) #590

Answered by timohubois
Iain-g asked this question in Q&A
Discussion options

You must be logged in to vote

@Iain-g in Flynt, namespaces are used and it looks like your functions.php file is missing one at the filter part. Based on your example, this should work:

function my_acf_google_map_api($api)
{
    $api['key'] = 'xxx';
    return $api;
};
add_filter('acf/fields/google_map/api', __NAMESPACE__ . '\my_acf_google_map_api');

Alternatively, you can use an anonymous function like this:

add_filter('acf/fields/google_map/api', function ($args) {
    $args['key'] = 'xxx';
    return $api;
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Iain-g
Comment options

Answer selected by Iain-g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants