aucor/polylang-copy-content
Composer 安装命令:
composer require aucor/polylang-copy-content
包简介
Copy content, title and attachments when creating a new translation with Polylang in WordPress
README 文档
README
Contributors: Teemu Suoranta, leemon (this plugin uses bits from Sync Attachments for Polylang)
Tags: polylang, media, attachments, admin, copy, content
License: GPLv2 or later
Description
⚠️ Status: In maintenance but not in very active development. Polylang Pro has this feature built-in and actively developed so I recommend supporting the creator of Polylang. ⚠️
Polylang Copy Content is an add-on for the multilingual WordPress plugin Polylang. This add-on let's you copy the content and the title WPML style when creating a new translation. All the images and galleries are translated automatically if you use media translations.
Basic feature list:
- Copy title, content and attachments for new translation
- Choose the language you want to copy from (make translation from the translated version's editor)
- Get useful translation markup for captions and title like (es translation) to be overwritten
- Media translation works for images, captions, galleries and featured image (if you use media translations)
- Use various filters to modify copied content in code (to be documented and expanded)
- Translations are done with Polylang's functions, no messing around
How copying content works?
Copy content basically just copies and pastes all the content first. In this phase this plugin won't need to understand any markup so any shortcodes etc are copied.
On second phase the plugin finds markup with regex, takes out the image IDs, makes or fetches the translation of the image and replaces these inside content. So the plugin can only replace translated images on the markup that this plugin undestands which is the default WordPress markup. If you have plugins that have their own fancy markup, blocks or shortcodes, this plugin copies them but will not process them.
Why processing images matter? If you have media translations enabled, you are able to translate captions and alternative texts. These texts live mainly in attachments so while copying the content we need to also replace the attachments to avoid messing up the original images (overwriting the captions etc).
Copy Content + Classic Editor
Works just fine. Copy content takes care of:
- Embedded images
- Galleries
- Featured image
Copy Content + Gutenberg
Works okay. Copy conten takes care of:
- Image blocks
- Gallery blocks
- Featured image
Copy content won't process
- Media & Text block (no captions)
- Custom ACF blocks
- Other blocks
If you get "invalid content" error on some block after copying content, you might need to safe draft and refresh the page and it will go away. No idea why as the markup doesn't seem to change.
Installation
Download and activate. That's it. You will need Polylang, too (d'oh).
Composer:
$ composer require aucor/polylang-copy-content
With composer.json:
{
"require": {
"aucor/polylang-copy-content": "*"
},
"extra": {
"installer-paths": {
"htdocs/wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
}
}
}
Issues and feature whishlist
Issues:
- Translating a link to a featured media page seems to make a broken link sometimes.
- Adding translation markup (fr translation) might be someting everybody won't like. Maybe I should
drop this in future ormake it optional.
Feature whishlist:
- UI to handel wheteher you want to copy things and choose the language
- Making the plugin itself translatable
- Ability to copy images to translation after translation has been created (if new images are added to the original version)
- Undo copying (remove image translations)
⭐⭐ Get integrated to Polylang ⭐⭐Polylang Pro has similar function that was build unknowingly of this plugin.
aucor/polylang-copy-content 适用场景与选型建议
aucor/polylang-copy-content 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.86k 次下载、GitHub Stars 达 37, 最近一次更新时间为 2016 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 aucor/polylang-copy-content 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aucor/polylang-copy-content 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 16.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 37
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2016-09-30