aucor / polylang-translate-existing-media

Bulk translate and replace all existing media in content, featured image and meta fields when you enable translations in media with Polylang.
GNU General Public License v2.0
28 stars 4 forks source link

Polylang Add-on: Translate existing media

Contributors: Teemu Suoranta

Tags: polylang, media, attachments, translations

License: GPLv2 or later

screen shot 2017-01-23 at 17 02 03

Description

Polylang Translate existing media is an add-on for the multilingual WordPress plugin Polylang. This add-on let's you bulk translate and replace all existing media in content, featured image and meta fields you enable translations in media. This plugin is based on my other Polylang plugin polylang-copy-content.

When to use:

Basic feature list:

This is open source and I cannot give you any guarantees, though it has worked for me in many projects. Please, report issues and contribute!

Installation

How-to use (takes around 5 minutes):

Composer:

$ composer aucor/polylang-translate-existing-media

With composer.json:

{
  "require": {
    "aucor/polylang-translate-existing-media": "*"
  },
  "extra": {
    "installer-paths": {
      "htdocs/wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
    }
  }
}

Filters

Add your own custom fields that have images saved as IDs:

function prefix_custom_fields_to_translate($custom_fields) {
    // return keys of your custom fields with image id
  return array(
    'my_custom_image_field',
    'other_custom_image_field'
  );
}
add_filter( 'polylang-translate-existing-media-custom-fields-with-image-id', 'prefix_custom_fields_to_translate' );

Issues and feature whishlist

Issues:

(No known issues, yet)

To-do:

Changelog

0.2.2

0.2