\DevOwl\MultilingualAbstractOutputBufferPlugin

There are plugins like TranslatePress, which does use a completely different way of implementing multilingual content to WordPress sites.

Summary

Methods
Properties
Constants
disableCopyAndSync()
getOriginalPostId()
getOriginalTermId()
getCurrentPostId()
getCurrentTermId()
No public properties found
HTML_TAG_KEEP
HTML_TAG_IGNORE
wrapArrayToHtml()
wrapHtmlToArray()
remapResultToReference()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

HTML_TAG_KEEP

HTML_TAG_KEEP ='keep-me'

Wrap the complete string within a HTML tag so our plugin can extract it correctly and handles it as HTML.

HTML_TAG_IGNORE

HTML_TAG_IGNORE ='<ignore-me-completely %s></ignore-me-completely>'

Our plugin does in general support JSON, but it slows down the site extremely, let's do this hacky with a single HTML string.

..

Methods

disableCopyAndSync()

disableCopyAndSync(  $sync)

Parameters

$sync

getOriginalPostId()

getOriginalPostId(  $id,  $post_type)

Parameters

$id
$post_type

getOriginalTermId()

getOriginalTermId(  $id,  $taxonomy)

Parameters

$id
$taxonomy

getCurrentPostId()

getCurrentPostId(  $id,  $post_type,  $locale = null)

Parameters

$id
$post_type
$locale

getCurrentTermId()

getCurrentTermId(  $id,  $taxonomy,  $locale = null)

Parameters

$id
$taxonomy
$locale

wrapArrayToHtml()

wrapArrayToHtml(array<mixed,string>  $content)

Wrap a complete array to valid HTML format so output buffer plugins can translate the HTML instead of JSON. This can be useful if the plugin does not support it well enough or JSON walker slows down the page extremely.

Parameters

array<mixed,string> $content

wrapHtmlToArray()

wrapHtmlToArray(string  $html,callable  $strip = null)

Reverse `wrapArrayToHtml` functionality.

Parameters

string $html
callable $strip

remapResultToReference()

remapResultToReference(array<mixed,string>  $content,array<mixed,string>  $result,string  $locale,array<mixed,string>  $context = null)

Remap the result to the referenced value `$content` for `translateString` method.

Parameters

array<mixed,string> $content
array<mixed,string> $result
string $locale
array<mixed,string> $context