Comments (5)
My plugin also uses 2000 for the action priority. Since it works, when lowering the priority for JetPack the easiest fix would be to increase the priority in my plugin to some higher value.
Also see here:
4fb9d96
If this works for you, I will include this for the next update.
from lightbox-photoswipe.
Actually it's the other way round. I changed the priority in your plugin.
Just did another check and 98 seems to be highest value, anything above that value causes the error.
from lightbox-photoswipe.
Hmm - this is bad news. A priority lower than about 200 will cause conflicts with other plugins - that's the reason why I set it to 2000 to be sure to get the output buffer after all other modifications.
As workaround you can keep your modification with a priority of 90. But I'll have to look into this as lowering the priority below 200 is definetly not an option, as this will break many sites.
from lightbox-photoswipe.
I tinkered with the infinite scroll code and was able to get it to run with your plugin left at 2000 priority.
if ( have_posts() ) {
// Fire wp_head to ensure that all necessary scripts are enqueued. Output isn't used, but scripts are extracted in self::action_wp_footer.
ob_start();
wp_head();
while ( ob_get_length() ) {
ob_end_clean();
}
ob_end_clean(); //forcing to clean and end the buffer seems to resolve the issue
$results['type'] = 'success';
It seems to be an issue with output buffer as in case with YoastSEO issue.
Forcing to clean and end the buffer seems to resolve the issue.
I am no PHP expert so I look forward to hear your opinion.
from lightbox-photoswipe.
After reviewing the code you mentioned - this translates to:
- start output buffering (
ob_start()
) - output the site header (
wp_head()
) - as long as there is anything in the output buffer, delete the buffer content and then end buffering (
while ( ob_get_length() ) { ob_end_clean(); }
) - delete the buffer and end buffering (
ob_end_clean()
)
So what this code wants to achive is to actually execute the WordPress header code but supress the output. That is already a very crude hack. But when opening a buffer it must be closed as well - even if there is nothing in it. I don't understand, why they call ob_end_clean()
only if there is anything in the buffer. Also after having called ob_end_clean()
the buffer is empty - there is no reason to this in conjunction with while( ob_get_length() )
. Also see https://www.php.net/manual/en/function.ob-end-clean.php.
I think this is a bug with the infinite scroll code which should be solved there.
from lightbox-photoswipe.
Related Issues (20)
- Add option to ignore images with a specific class
- Add customization for zoom levels in PhotoSwipe 5
- Add content filter to process output HOT 1
- EXIF support for webp HOT 1
- Support to replace "expand on click" in WordPress 6.4
- Backend based captions fail with Jetpack tiled galleries HOT 1
- Add option to use image title as caption
- PHP Warning: extract() expects parameter 1 to be array, bool given HOT 2
- Click handler does not work in Meow gallery HOT 1
- Add filter to override frontend options
- Captions are not displayed for scaled images HOT 1
- Restore focus when closing the lightbox HOT 1
- Adding images dynamically to Photoswipe after they are loaded with ajax HOT 7
- The picture of Aliyun oss and the original picture protection option is turned on, which causes the lightbox to be incorrectly loaded in the article HOT 28
- Add filter for caption content
- cross-domain download HOT 5
- Add support for padding in PS5 HOT 1
- Add option to limit image size (width/height) in lightbox HOT 1
- Wrong path usage with `get_home_url` HOT 4
- Error when trying to build HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightbox-photoswipe.