PHP Class VersionPress\Database\ShortcodesInfo

The information is loaded from a shortcodes.yml files.
Afficher le fichier Open project: versionpress/versionpress Class Usage Examples

Méthodes publiques

Méthode 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 méthode

public __construct ( $shortcodeFiles )

getAllShortcodeNames() public méthode

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

getShortcodeInfo() public méthode

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

getShortcodeLocations() public méthode

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
Résultat array