Please or Register to create posts and topics.

Using shortcode embedded in other modules

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:

  1. In the ensuing time, is there a different workaround that has been discovered?
  2. executePlugin is presumably false in some instances because of performance or other reasons. What is the downside to setting it true?
  3. 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?

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.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!