Open crisc2000 opened 6 years ago
Thanks for the suggestions. I changed the code. Update the plugin in Wordpress to version 1.2.3.
I like the idea with the checkboxes. In a later version I will add that. As a standard value I will take "enabled", so that the behavior does not change suddenly when updating.
i used 1.15 and it used to work great. now i have updated to 1.22 and this don't work anymore. i have looked at your code and i have some observations.
1) do not mess with the default behavior of the box scripts i understand that you probably have created this for personal purposes, but the behaviour of the box scripts should be their default specified in their docs http://lokeshdhakar.com/projects/lightbox2/ , http://fancyapps.com/fancybox/3/docs/ . if a wordpress user add image code in the Wordpress text editor, according to the scripts documentation it should work exactly as the default. if you change the default behavior it you be as option in the plugin options, and that option it should not be the default.
you should not alter "data-lightbox / data-fancybox" or "data-title / data-caption" attribute if this attribute is already present on image link (even if is null). example, if this data is added in wordpress post text editor:
in new version of your plugin an existing data-lightbox attribute is modified breaking the grouping. old version work ok.
2) do not mess with the default behaviour of wordpress without giving options to user in the new version your plugin overwrite the default behavior of the gallery and standalone images without asking the user.
You should add some checkbox options: "Enable lightbox for wordpress gallery" "Enable lightbox for wordpress standalone images" I personally would prefer that this options to be disabled by default. the lightbox only to apply to images that have "data-lightbox/fancybox" attribute manually introduced by user.