| 开发者 | addblack |
|---|---|
| 更新时间 | 2026年10月31日 16:20 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
On activation every existing post is assigned to the default language. Nothing else changes until you add translations.
It is made for it: the Language panel, the Translate button and block-safe translation live in the block editor. Content that uses the classic editor is still translated by "Translate everything" (on the server), and the plugin tells you which post types have the block editor turned off.
Translations, URLs and SEO work. The language switcher can be added to a theme menu from the settings (no code), with the [blocklingo_switcher] shortcode or with blocklingo_language_switcher(). Per-language header and footer need a block theme.
[blocklingo_switcher display="name" hide_current="1" hide_missing="1"]. display: code, name, flag, flag-code or flag-name (default code). hide_current hides the current language, hide_missing hides languages without a translation of the page.
PHP strings (__(), e(), esc_html_(), _x() ...) used while a page renders, when no translation file covers them. Not covered yet: plural forms (_n()), strings in JavaScript, texts saved in plugin settings (e.g. Contact Form 7 form fields).
Nothing, unless you ask for it. By default the links between translations, the language strings and the settings stay, so installing the plugin again brings everything back. To remove them, turn on "Remove all data when the plugin is deleted" (Settings > Blocklingo > Content and sync) before deleting. Posts, terms, menus and template parts in every language always stay - they are content. Deactivating the plugin keeps everything; while it is off, language URLs like /uk/ stop working and translations show up as ordinary posts and pages.
Functions: blocklingo_languages(), blocklingo_default_lang(), blocklingo_current_lang(), blocklingo_is_language(), blocklingo_is_translatable_type(), blocklingo_get_post_lang(), blocklingo_set_post_lang(), blocklingo_get_post_translations(), blocklingo_get_post_translation(), blocklingo_language_switcher(). Filters: blocklingo_untranslated_blocks, blocklingo_strings_capture, blocklingo_strings_skip_domains, blocklingo_translatable_block_attributes, blocklingo_translatable_meta, blocklingo_per_language_meta, blocklingo_skip_meta_keys, blocklingo_sync_meta_key, blocklingo_sync_taxonomy, blocklingo_translatable_taxonomies, blocklingo_context_max_chars, blocklingo_pre_provider, blocklingo_support_url. Action: blocklingo_translation_created. Queries accept 'lang' => 'uk' or 'all'.