-
Notifications
You must be signed in to change notification settings - Fork 7
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
Jetpack's Infinite Scroll not working with lightbox-photoswipe plugin active #45
Comments
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: If this works for you, I will include this for the next update. |
Actually it's the other way round. I changed the priority in your plugin. |
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. |
I tinkered with the infinite scroll code and was able to get it to run with your plugin left at 2000 priority.
It seems to be an issue with output buffer as in case with YoastSEO issue. I am no PHP expert so I look forward to hear your opinion. |
After reviewing the code you mentioned - this translates to:
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 I think this is a bug with the infinite scroll code which should be solved there. |
Hi, I have a problem with getting Jetpack's infinite scroll to work when your plugin is active.
I was able to determine that the response to the request sent by infinite scroll contains some HTML code from site header. It results in following error:
Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.xhr.onload (infinity.min.js?ver=8.6.1-is5.0.0:3)
I changed the priority in
add_action('wp_head', array($this, 'bufferStart'), 2000);
from 2000 to 90 and it works well, however I suppose it's a temporary and dirty hack.Any thoughts on how this can be solved?
The text was updated successfully, but these errors were encountered: