PHP 클래스 VersionPress\Database\ShortcodesReplacer

!!! This class uses many functions of wp-includes/shortcodes.php, there is no easy way around it.
파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ShortcodesInfo $shortcodeInfo, VpidRepository $vpidRepository )
entityCanContainShortcodes ( string $entityName ) : boolean Return true if entity can contain shortcodes
fieldCanContainShortcodes ( string $entityName, string $field ) : boolean Return true if a field on an entity can contain shortcodes
replaceShortcodesInEntity ( string $entityName, array $entity ) : array Translates IDs to VPIDs in shortcodes for an entity
restoreShortcodesInEntity ( string $entityName, array $entity ) : array Translates VPIDs to IDs in shortcodes for an entity

비공개 메소드들

메소드 설명
createReplaceCallback ( $idProvider )
getIdByVpid ( $entityName, $vpid )
getVpidByEntityNameAndId ( $entityName, $id )
replaceShortcodes ( string $string ) : string Translates IDs to VPIDs in shortcodes.
restoreShortcodes ( string $string ) : string Translates VPIDs to IDs in shortcodes.

메소드 상세

__construct() 공개 메소드

public __construct ( ShortcodesInfo $shortcodeInfo, VpidRepository $vpidRepository )
$shortcodeInfo ShortcodesInfo
$vpidRepository VpidRepository

entityCanContainShortcodes() 공개 메소드

Return true if entity can contain shortcodes
public entityCanContainShortcodes ( string $entityName ) : boolean
$entityName string
리턴 boolean

fieldCanContainShortcodes() 공개 메소드

Return true if a field on an entity can contain shortcodes
public fieldCanContainShortcodes ( string $entityName, string $field ) : boolean
$entityName string E.g., 'post'
$field string E.g., 'post_content'
리턴 boolean

replaceShortcodesInEntity() 공개 메소드

Translates IDs to VPIDs in shortcodes for an entity
public replaceShortcodesInEntity ( string $entityName, array $entity ) : array
$entityName string
$entity array Entity data, see {@link WpdbMirrorBridge}
리턴 array Entity data

restoreShortcodesInEntity() 공개 메소드

Translates VPIDs to IDs in shortcodes for an entity
public restoreShortcodesInEntity ( string $entityName, array $entity ) : array
$entityName string
$entity array Entity data, see {@link WpdbMirrorBridge}
리턴 array Entity data