Closed yonkov closed 1 year ago
is to give users like me an option to override this function, at their own risk.
The shortcode is supposed to apply to everyone. Therefore, this will be the best solution. But then we should take the content of the popup as it is (without addslashes, htmlspecialchars, unescape). Whether it is then displayed in popup is another matter. I tried it once with Photonic - I couldn't get it work. But a simple WordPress gallery works.
This is never going to fly with the wordpress plugin in general. I would like to know if v3.2.0 works for you however. Or, if you could improve this merge request to be more generally applicable. As it is, it obviously can't be merged. Thanks for the background info though.
@bozdoz , I created this PR for testing purposes. not with the idea to be merged. Unfortunately, I tested the the current version 3.2.0 but it does not work for me, due to the reasons I mentioned in the PR description. The gallery shortcode inside the leaflet popup is working, which is an improvement from before. However, when you click on gallery item, the lightbox is not working, so this solution is not really useful for me. The commented code allows for the lightbox to work. Being a plugin and theme developer myself, I am fully aware this solution is against wp.org guidelines, so I was hoping that you would come up with something else..
Steps to Reproduce
This is an important step in order to enable the lightbox
Install Lightbox with Photoswipe plugin We need it for the Lightbox to work.
Add the Shortcode in any page with leaflet map like so (replace id with the custom post type id)
(By the way, there is some overflow which wasn't in the previous plugin version (December 2022) and causes the header of the popup to be missing)
Expected result
The gallery and the lightbox should be working like so:![image](https://user-images.githubusercontent.com/26258032/218210629-e4479a8a-4cdd-4c46-8224-a65056939edb.png)
Proposed steps
The current PR comments the two problematic lines and the lightbox is now working when you click on an image from the gallery!
Conclusion
I suppose these lines are important for security, so I made it for testing purposes only, A better approach in my opinion, is to give users like me an option to override this function, at their own risk. Otherwise, I am not able to reproduce the design requirements and I am failing with the project unless I "hack" the plugin and get stuck with using an old and insecure version. Thank you for the understanding and hopefully a solution would be made soon