承接 hirasso/acf-multilingual 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hirasso/acf-multilingual

最新稳定版本:v3.2.2

Composer 安装命令:

composer require hirasso/acf-multilingual

包简介

An experimental plugin for building multilingual websites using WordPress and Advanced Custom Fields 🌀

README 文档

README

Latest Version on Packagist Test Status

An experimental plugin for building multilingual websites using WordPress and Advanced Custom Fields 🌀

Limitations

Does NOT integrate with plugins that add additional fields to the WordPress Admin, like e.g. Yoast SEO. Works best with fully customized pure WordPress/ACF setups.

Why did I make this public?

I made this public in the hopes to make it more sustainable and fail-proof. You will probably not want to use this plugin in big corporate projects, just yet (or ever). Use it for a personal website or the likes and report bugs and problems.

Usage

Installation

Via Composer (recommended):

  1. Install the plugin:
composer require hirasso/acf-multilingual
  1. Activate the plugin manually or using WP CLI:
wp plugin activate acf-multilingual

Manually:

  1. Download and extract the plugin from the latest release
  2. Copy the acf-multilingual folder into your wp-content/plugins folder
  3. Activate the plugin via the plugins admin page – Done!
  4. Handle updates via afragen/git-updater

Setup

Add as many languages as you like. The languages will be injected into the URL, like this:

https://yoursite.tld/your-post/ < default language
https://yoursite.tld/de/dein-eintrag/ < german translation
https://yoursite.tld/es/tu-entrada/ < spanish translation

Put a file acfml.config.json in your theme root, for example with these contents:

{
  "languages": {
    "en": {
      "locale": "en_US",
      "name": "English"
    },
    "de": {
      "locale": "de_DE",
      "name": "Deutsch"
    }
  },
  "post_types": {
    "page": true,
    "project": {
      "de": {
        "rewrite_slug": "projekt",
        "archive_slug": "projekte"
      }
    }
  },
  "taxonomies": {
    "filter": true
  }
}

This config will make:

  • English the default language
  • Deutsch the second language
  • The post type "page" translatable
  • The post type "project" translatable, with custom rewrite slugs for german
  • The custom taxonomy "filter" translatable

API

To get an idea about what the plugin can do, it's probably quickest to have a look at the API.

Make ACF fields multilingual

Set ACF fields to be multilingual, so that they can be translated for every language. like e.g. Text, Textarea, WYSIWYG, ... (for the full list see $multilingual_field_types in the class FieldsController):

CleanShot 2025-11-13 at 09 36 58@2x

Now the field can be translated!

CleanShot 2025-11-13 at 09 38 21@2x

If you use vinkla/extended-acf, you can make fields multilingual like so:

\Extended\ACF\Fields\Text::make('Text')
    ->withSettings(['acfml_multilingual' => true]);

If a field is not marked multilingual, it will display the same value in both languages.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-11-05