Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering Image-Array #56

Closed
worldoptimizer opened this issue Feb 27, 2021 · 2 comments
Closed

Filtering Image-Array #56

worldoptimizer opened this issue Feb 27, 2021 · 2 comments

Comments

@worldoptimizer
Copy link

worldoptimizer commented Feb 27, 2021

Awesome plugin. Love it! Is there a buy me a coffee link somewhere?

Also, is there a filter to slim down what is returned from the original image array? And maybe even what is returned from the images array if set Image-Array? Or would you suggest another method?

@joppuyo
Copy link
Owner

joppuyo commented Mar 1, 2021

Hey,

You can filter the value returned by the plugin by using the built-in ACF filter acf/format_value:

add_filter('acf/format_value/type=image_aspect_ratio_crop', function($value, $post_id, $field) {
    if (!is_array($value)) {
        return $value;
    }
    $value['foo'] = 'bar';
    return $value;
}, 20, 3);

If you want to support the plugin, I have a GitHub Sponsors page.

@joppuyo
Copy link
Owner

joppuyo commented Feb 1, 2022

Hey,

Since this seems to be solved, I'm closing this issue. Feel free to reopen if there are any further questions.

@joppuyo joppuyo closed this as completed Feb 1, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants