PHP Class VersionPress\Database\ShortcodesInfo

The information is loaded from a shortcodes.yml files.
Show file Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method Description
__construct ( $shortcodeFiles )
getAllShortcodeNames ( ) : string[] Returns all supported shortcode names - keys from the shortcodes array in the YAML file.
getShortcodeInfo ( string $shortcodeName ) : array Returns description of a single shortcode as a map between shortcode attributes and entity names, e.g.:
getShortcodeLocations ( ) : array Returns a list of entities and their fields where shortcodes are supported.

Method Details

__construct() public method

public __construct ( $shortcodeFiles )

getAllShortcodeNames() public method

Returns all supported shortcode names - keys from the shortcodes array in the YAML file.
public getAllShortcodeNames ( ) : string[]
return string[]

getShortcodeInfo() public method

[ 'id' => 'post', 'include' => 'post' ]
public getShortcodeInfo ( string $shortcodeName ) : array
$shortcodeName string
return array

getShortcodeLocations() public method

For example, vanilla WordPress only supports shortcodes in posts / their post_content column so the array would look like this: [ 'post' => [ 'post_content' ] ]
public getShortcodeLocations ( ) : array
return array