You are here

function hook_xbbcode_TAG_render in Extensible BBCode 8

Same name and namespace in other branches
  1. 8.2 xbbcode.api.php \hook_xbbcode_TAG_render()
  2. 7 xbbcode.api.php \hook_xbbcode_TAG_render()

Sample render callback.

Note: This is not really a hook. The function name is manually specified via the 'callback' key in hook_xbbcode_info().

Parameters

$tag: The tag to be rendered. This object has the following properties:

  • name: Name of the tag
  • content: The text between opening and closing tags.
  • option: The single argument, if one was entered as in [tag=option].
  • attr($name): A function that returns a named attribute's value.

$xbbcode_filter: The filter object that is processing the text. The process() and render_tag() functions on this object may be used to generate and render further text, but care must be taken to avoid an infinite recursion. The object will also have the following properties:

  • filter: Drupal's filter object, including the settings.
  • format: The text format object, including a list of its other filters.
  • tags: All tags enabled in this filter.

Return value

HTML markup code. If NULL is returned, the tag will be left unrendered.

1 string reference to 'hook_xbbcode_TAG_render'
hook_xbbcode_info in ./xbbcode.api.php
Define tags that can be used by XBBCode.

File

./xbbcode.api.php, line 108
Hooks provided by the XBBCode module.

Code

function hook_xbbcode_TAG_render($tag, $xbbcode_filter) {
  return highlight_string($tag->content, TRUE);
}