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 custom image path doesn't work #18

Open
joshkemmer opened this issue May 10, 2023 · 1 comment
Open

Filtering custom image path doesn't work #18

joshkemmer opened this issue May 10, 2023 · 1 comment

Comments

@joshkemmer
Copy link

I can't get the custom image path to work. The default image path works fine.

  • My ACF layout is named main_content_row and my image is named main-content-row.jpg (the default path works, so it's not an issue with field/image naming)
  • The image lives at THEME/assets/images/acf-flexible-content-extended
  • Here's my filter statement:
    • add_filter( 'acf-flexible-content-extended.images_path', 'assets/images/acf-flexible-content-extended' );
  • It resorts to the default image

Version information

  • Plugin version: 2.0.0
  • ACF version: 6.1.6
  • PHP: 8.0.22
  • WordPress: 6.2
@Warface
Copy link

Warface commented Oct 18, 2024

That's because the filter needs a callback function to work. Here's the fix

add_filter( 'acf-flexible-content-extended.images_path', function() { return 'assets/images/acf-flexible-content-extended'; });

Now it should check in the right folder

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