You are here

function hook_shortcode_info_alter in Shortcode 7.2

Alter existing Shortcode definition.

@hook hook_shortcode_info_alter()

Parameters

array $shortcodes: An associative array of shortcodes

Return value

array An associative array of shortcodes, whose keys are internal Shortcode names, which should be unique. Each value is an associative array describing the shortcode, with the following elements (all are optional except as noted):

  • title: (required) An administrative summary of what the shortcode does.
  • description: Additional administrative information about the shortcode's behavior, if needed for clarification.
  • settings callback: The name of a function that returns configuration form elements for the shortcode.
  • default settings: An associative array containing default settings for the shortcode, to be applied when the shortcode has not been configured yet.
  • process callback: (required) The name the function that performs the actual shortcodeing.
  • tips callback: The name of a function that returns end-user-facing Shortcode usage guidelines for the shortcode.
1 invocation of hook_shortcode_info_alter()
shortcode_list_all in ./shortcode.module
Builds a list of all ShortCodes (for filter).

File

./shortcode.api.php, line 76
Shortcode API documentation.

Code

function hook_shortcode_info_alter(&$shortcodes) {

  // Example to change the process callback for quote macro.
  $shortcodes['quote']['process callback'] = 'MYMODULE_shortcode_quote';
}