Using shortcode embedded in other modules
Quote from klflote17 on February 25, 2024, 1:42 amI’m trying to have other code (a wpcode snippet) display the forum using a shortcode [forum]. This mostly works except that some of the headers are not included — apparently because in enqueue_css_js(), the executePlugin value is false, and so the af-style (and other things) don’t get enqueued. Seems like someone else had this problem some 6.5 years ago: https://asgaros.com/support/topic/using-shortcode-in-custom-field/
So yeah, I can set executePlugin to true in the code, but then when I upgrade the plugin, I’ll lose that change and my site will break. So wondering three things:
- In the ensuing time, is there a different workaround that has been discovered?
- executePlugin is presumably false in some instances because of performance or other reasons. What is the downside to setting it true?
- Assuming there is no workaround and the issues with setting it true by default are minor, would you accept a patch to make that a settable option?
I’m trying to have other code (a wpcode snippet) display the forum using a shortcode [forum]. This mostly works except that some of the headers are not included — apparently because in enqueue_css_js(), the executePlugin value is false, and so the af-style (and other things) don’t get enqueued. Seems like someone else had this problem some 6.5 years ago: https://asgaros.com/support/topic/using-shortcode-in-custom-field/
So yeah, I can set executePlugin to true in the code, but then when I upgrade the plugin, I’ll lose that change and my site will break. So wondering three things:
- In the ensuing time, is there a different workaround that has been discovered?
- executePlugin is presumably false in some instances because of performance or other reasons. What is the downside to setting it true?
- Assuming there is no workaround and the issues with setting it true by default are minor, would you accept a patch to make that a settable option?
Quote from Asgaros on March 21, 2026, 12:39 pmThis flag is used to check if the user is currently on a forum page. If this is the case, related styles and scripts are loaded, to avoid unnecessary requests on other pages. In your case, since the shortcode is not directly included in the page, the plugin has unfortunately no way to determine its existence. The only way is to change the corresponding code manually, as you did already.
This flag is used to check if the user is currently on a forum page. If this is the case, related styles and scripts are loaded, to avoid unnecessary requests on other pages. In your case, since the shortcode is not directly included in the page, the plugin has unfortunately no way to determine its existence. The only way is to change the corresponding code manually, as you did already.
