[ Index ]

PHP Cross Reference of WordPress




/wp-includes/js/dist/ -> shortcode.js (summary)

(no description)

File Size: 634 lines (20 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 10 functions


Functions that are not part of a class:

__webpack_require__(moduleId)   X-Ref
No description

getDefault()   X-Ref
No description

getModuleExports()   X-Ref
No description

next(tag, text)   X-Ref
Find the next matching shortcode.

param: {string} tag   Shortcode tag.
param: {string} text  Text to search.
param: {number} index Index to start search from.
return: {?WPShortcodeMatch} Matched information.

replace(tag, text, callback)   X-Ref
Replace matching shortcodes in a block of text.

param: {string}   tag      Shortcode tag.
param: {string}   text     Text to search.
param: {Function} callback Function to process the match and return
return: {string} Text with shortcodes replaced.

string(options)   X-Ref
Generate a string from shortcode parameters.

Creates a shortcode instance and returns a string.

Accepts the same `options` as the `shortcode()` constructor, containing a
`tag` string, a string or object of `attrs`, a boolean indicating whether to
format the shortcode using a `single` tag, and a `content` string.

param: {Object} options
return: {string} String representation of the shortcode.

regexp(tag)   X-Ref
Generate a RegExp to identify a shortcode.

The base regex is functionally equivalent to the one found in
`get_shortcode_regex()` in `wp-includes/shortcodes.php`.

Capture groups:

1. An extra `[` to allow for escaping shortcodes with double `[[]]`
2. The shortcode name
3. The shortcode argument list
4. The self closing `/`
5. The content of a shortcode when it wraps some content.
6. The closing tag.
7. An extra `]` to allow for escaping shortcodes with double `[[]]`

param: {string} tag Shortcode tag.
return: {RegExp} Shortcode RegExp.

fromMatch(match)   X-Ref
Generate a Shortcode Object from a RegExp match.

Accepts a `match` object from calling `regexp.exec()` on a `RegExp` generated
by `regexp()`. `match` can also be set to the `arguments` from a callback
passed to `regexp.replace()`.

param: {Array} match Match array.
return: {WPShortcode} Shortcode instance.

memize( fn, options )   X-Ref
Accepts a function to be memoized, and returns a new memoized function, with
optional options.

param: {F}             fn        Function to memoize.
param: {MemizeOptions} [options] Options object.
return: {F & MemizeMemoizedFunction} Memoized function.

memoized( )   X-Ref
No description

Generated: Wed Apr 21 01:00:05 2021 Cross-referenced by PHPXref 0.7.1