I’m looking to reuse some small portions of html inside several pages/post but I don’t know how to obtain this on WordPress.
It would be nice if I could have a helper in the editor to include them, but this is only a nice to have feature, for the moment I need a solution for this.
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:
- Coding PHP function that would process data, passed by API from shortcode.
- 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.