Download the PHP package peakhmr/wpml without Composer
On this page you can find all versions of the php package peakhmr/wpml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package wpml
Short Description Corcel Multilingual Plugin for WPML [The WordPress Multilingual Plugin]
License MIT
Homepage https://github.com/peakhmr/wpml
Informations about the package wpml
Corcel WPML
This package allows you to use Corcel WordPress plugin with The WordPress Multilingual Plugin that allow you to easily build multilingual sites and run them. It’s powerful enough for corporate sites, yet simple for blogs.
Installation
This package is still in development
To install Corcel WPML, just run the following command:
Usage
Posts
Every time you see Post::method(), if you're using your own Post class (where you set the connection name), like App\Post you should use App\Post::method() and not Post::method(). All the examples are assuming you already know this difference.
Pages
Pages are like custom post types. You can use Post::type('page') or the Page class.
For documentation please visit jgrossi/corcel for Corcel's usage and then come back here for how to use wpml plugin.
Translations
By using the
$post
object, we can access to the translation created by WPML.
Instead of using Corcel\Post
, we use Wpml\Post
to Override few variables. The plugin will look for wp_posts.ID
in icl_translations.element_id
and return a collection of icl_translations.trid
.
Translate Post or Page
If you want to get the translated post object, use translate()
scope and passing the icl_translations.language_code
as parameter. This will return Corcel\Post
object as expected.
Advanced Custom Field, Field Keys
Add the follwing PHP script to your WordPress theme's function.php
. This script will append a button Transfer Advanced Custom Field Accessor Keys
to the Multilingual Content Seup
section. This action button will toggle all _field_key
as copy
for you.