CyberChimps Home › Forums › Free Support › Business Lite › Business Lite Support › the_content being called too many times for gallery format
Tagged: format, gallery, processing, unnecessary
This topic contains 1 reply, has 2 voices, and was last updated by Bryan Hadaway 6 months, 4 weeks ago.
-
AuthorPosts
-
October 23, 2012 at 2:37 am #56056
Hi, I hope you can help. I developed the oik-nivo-slider wordpress plugin. Someone using the Business Lite theme reported a problem on the support forum: http://wordpress.org/support/topic/plugin-oik-nivo-slider-images-not-showing
I don’t know if I reproduced their problem ( very unlikely given the information I received ) but I did manage to get a similar problem when I attempted to display three nivo sliders in a single post using the Gallery format.
Basically the images in the third slider did not appear.
In this scenario the third slider gets an id of “slider-6″ and because of another problem (with the nivo slider code itself, see the support topic) the images for the third slider do not show. Now, I know how to fix that problem. But my question was “Why is it happening?”
The answer is in the number of times that the content gets filtered by ‘the_content’.
My shortcodes first get expanded in the_content() in business_loop_content() in global-actions.php (line 85) then again during apply_filters for ‘business_post_formats_gallery_content’ in business_custom_gallery_post_format(). This function ignores the $content passed in and calls the_content() all over again. And my shortcodes then produce different results.
For this scenario with the gallery post format there was no need to perform the logic between ob_start and ob_get_clean.
Fixing this code could potentially save a lot of processing and result in fewer unwanted side effects.
Comments?
Herb Miller, oik-plugins
October 23, 2012 at 4:26 pm #56126We’re actually completely revamping the framework from scratch which should play a lot better with plugins, IE etc.
This would be something for development to comment on. However, like I said, they’re already very busy making a lot of improvements so no need to bug them.
You might consider beta testing the new framework:
http://cyberchimps.com/2012/10/the-new-framework-is-coming-we-need-beta-testers/
and you can directly submit any conflicting bugs that might remain for your plugin.
CyberChimps Community Manager | Web & Graphic Designer
Design: http://calmestghost.com/ | Blog: http://bryanhadaway.com/(please do not contact me privately regarding CyberChimps related issues – use https://cyberchimps.com/contact/)
-
AuthorPosts
CyberChimps
0 Items $0