add_shortcode — Add a shortcode.

Added in version 2.2.

View-related functions

Summary

add_shortcode($shortcodeName, $function)

Add a shortcode.

Parameters:
  • $shortcodeName (string) – Name of the new shortcode.

  • $function (callback) – Callback to execute for this shortcode.

Usage

Examples

See Also

For a discussion of how to use add_shortcode, see Working with Shortcodes.