
We’re transforming language technology, opening the door to global business so you can reach more people, make deeper connections, and drive growth. Phrase is the leading translation management system, offering a comprehensive suite of translation tools that’s intuitive to use and simple to integrate so you can focus on forming deeper connections with people across cultures. We help organizations like Uber, Shopify, Volkswagen, and thousands of others accelerate their global growth by giving people the content they need, in the language they speak.
At Phrase, we:
The Phrase TMS Integration supports both WPML and MultilingualPress.
The integration is available with the Ultimate and Enterprise Phrase TMS plans. Contact us for licensing information, or to schedule a demo.
The plugin exposes two PHP filters so you can define which custom Gutenberg block and
shortcode attributes are translatable in your own version-controlled code (e.g. a
functions.php or a site-specific mu-plugin), instead of only through the admin UI. Each
filter receives the configuration already assembled from the plugin’s shipped defaults and
the admin UI, and must return the final configuration the plugin will use — sites that don’t
define either filter are unaffected.
Register your callback at the top level of functions.php, a mu-plugin, or a regular site
plugin — not from inside a conditional hook (e.g. only on is_admin() or a specific page
request) that may not run on the REST API or content-transform requests this plugin’s hooks
resolve on.
Runs when the plugin resolves which Gutenberg block attributes are translatable. Receives
the attributes already assembled from the shipped defaults and the admin UI, keyed by block
name, and must return the same shape:
add_filter('memsource_custom_blocks', function (array $blocks): array {
$blocks['my-plugin/testimonial']['authorName'] = true;
$blocks['my-plugin/testimonial']['quote'] = true;
return $blocks;
});
For an attribute you add or change, the value must be the boolean true. (The shipped/admin-UI
values you receive are usually true too, but aren’t guaranteed to be — don’t rely on their
exact form, only ever set your own attributes to true.) An attribute name ending in * (e.g.
‘item*’ => true) is expanded the same way as shipped/admin-configured wildcard attributes.
Runs when the plugin resolves its shortcode configuration (type, tag, attributes). Receives
the list of shortcode definitions already assembled from the shipped defaults and the admin
UI, and must return the final list the plugin will use as-is — there is no merging or
deduplication after this filter runs.
An entry already sourced from the database (as opposed to one you add or fully replace
yourself) carries extra database detail: its editable/ignore_body values may be the
database driver’s string form ('0'/'1') rather than a native boolean, the shortcode entry
itself carries a database id, and each of its attributes carries id/short_code_id too.
These are implementation detail of the existing data, not something you need to set — an
entry you add or fully replace only needs the fields shown below.
Shortcode identity is the (tag, editable) pair (tag compared case-insensitively) — the
same identity the plugin already uses to resolve its shipped/admin-UI configuration. Your
callback is responsible for keeping the returned list valid:
(tag, editable) pair.(tag, editable) pair doesn’t already(tag, editable)Change an existing shortcode’s configuration by modifying its entry in place:
add_filter('memsource_custom_shortcodes', function (array $shortcodes): array {
foreach ($shortcodes as $key => $shortcode) {
if ($shortcode['tag'] === 'vc_column_text') {
$shortcodes[$key]['attributes'][] = [
'name' => 'title', 'type' => null, 'encoding' => null, 'editable' => false, 'status' => 'Active',
];
break;
}
}
return $shortcodes;
});
Add a new shortcode by appending it:
add_filter('memsource_custom_shortcodes', function (array $shortcodes): array {
$shortcodes[] = [
'type' => 'My Plugin',
'tag' => 'my_testimonial',
'ignore_body' => false,
'editable' => false,
'status' => 'Active',
'delimiter' => '"',
'attributes' => [
['name' => 'author', 'type' => null, 'encoding' => null, 'editable' => false, 'status' => 'Active'],
],
];
return $shortcodes;
});