This plugin adds translatable fields for Carbon Fields using qTranslate-X.
You can install this plugin in two ways:
-
Install the plugin from Wordpress Plugins.
-
To install the plugin using Composer and wpackagist, add the following line to composer.json:
"wpackagist-plugin/carbon-fields-qtranslate": "1.0.1"
For translatable text field, use translatable_text
as field type.
namespace Example\Cpt;
function create_fields() {
if ( ! function_exists( 'carbon_get_post_meta' ) ) {
return;
}
\Carbon_Fields\Container::make( 'post_meta', __( 'Post Data', 'some-domain' ) )
->show_on_post_type( 'post' )
->add_fields([
\Carbon_Fields\Field::make( 'translatable_text', 'Additional Text' ),
]);
}
add_action( 'carbon_register_fields', 'Example\Cpt\create_fields' );
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.
If you have encountered a bug, please use Github Issues to submit a an issue.
Before submitting pull request please conform to Wordpress PHP Coding Standards. Naming class names and file names are an exception to these guidelines until we can find a better solution.
- Fork this repository
- Create a new branch from master
- Commit your changes
- Push to the newly created branch
- Submit a pull request
- Sit back, relax, and wait for a response 😃
Add plugin to wordpress.orgAdd this package to wpackagist.org- Add more translatable fields (TextArea, RichText)
This project is licensed under GPLv3. Please read the LICENSE file for details.