Shortcodes: override a shortcode / change shortcode on the fly

Here’s what I’ve done:created a shortcode where I do [myplugin language="fr" id="5"][myplugin language="us" id="8"] and then, when this page is called, it calls myplugin twice. If it’s not on the right page, my plugin returns nothing. So, when this page is called:

  • if it’s on a domain like “mydomain.fr” I just call do_shortcode("othershortcode 5")
  • if it’s on a domain like “mydomain.us” I just call do_shortcode("othershortcode 8")

It works like a charm!