How do I add my own custom shortcodes?

Shortcodes work via Shortcode API. Essentially shortcode is just a human-friendly form of writing out data that is processed and passed to associated PHP function.

So adding your own shortcode involves:

  1. Coding PHP function that would process data, passed by API from shortcode.
  2. Registering that function as shortcode handler.

I also remember WP Utility Short Codes plugin was recommended in answer to some question while back as good way to insert snippets and such in editor.

Leave a Comment