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

Function item_image_gallery seems to have no filter applied #948

Open
DBinaghi opened this issue Apr 15, 2021 · 2 comments
Open

Function item_image_gallery seems to have no filter applied #948

DBinaghi opened this issue Apr 15, 2021 · 2 comments

Comments

@DBinaghi
Copy link
Contributor

It looks like the item_image_gallery function has not filter applied, although there's plenty of filters associated to files and their markup.

I wonder whether replacing

if ($attrs['linkWrapper'] !== null) {
    $html .= '</div>';
}

with

if ($attrs['linkWrapper'] !== null) {
   $html .= '</div>';
}
		
$html = apply_filters(
     'file_markup',
     $html,
     array(
          'file' => $file
     )
 );

could solve the issue. Not sure whether any other parameter has to be passed, though.

@zerocrates
Copy link
Member

You definitely don't want to apply the file_markup filter here, it's for a different use so the filters are going to be doing different things and expecting different arguments, and so on.

I would think we could probably most usefully filter on the attributes for each link... we could also/alternatively filter the markup for each link, or just filter the entire markup (usually that's a little unwieldy but sometimes useful). In any of these cases they'd be new filters with new names.

@DBinaghi
Copy link
Contributor Author

I guess filtering the entire markup would give the most freedom, in this case.

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