-
Notifications
You must be signed in to change notification settings - Fork 17
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
Added filter to support images regexp modifications #52
Conversation
inc/frontend/namespace.php
Outdated
* 2 => Attachment ID | ||
* ] | ||
*/ | ||
$preg_match_result = apply_filters_ref_array( 'gaussholder.mangle_images_regexp_results', array( $preg_match_result, &$images, $content, $searcher ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the &$
will break in PHP 7.4 and shouldn't really be needed any more. It's best to declare the variable first, then let the function modify it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roborourke I just tested it it 7.4 and it would fail outside an array but I'm using here apply_filters_ref_array
and passing an array so I'm not seeing any error. Otherwise, the images list could not be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, I thought it would fatal or at least chuck out a warning. I guess we're a ways off adopting PHP 7.4 anyway so 👍 - thanks for confirming it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one edit to make and then fine to merge
All good. Thanks @roborourke, merging this. |
This will allow to filter tags used by certain page builders. Some of them will change the way images are displayed in WP.