Skip to content

appristas/carbon-fields-qtranslate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carbon Fields: qTranslate

This plugin adds translatable fields for Carbon Fields using qTranslate-X.

Installation

You can install this plugin in two ways:

  1. Install the plugin from Wordpress Plugins.

  2. To install the plugin using Composer and wpackagist, add the following line to composer.json:

     "wpackagist-plugin/carbon-fields-qtranslate": "1.0.1"
    

Getting Started

Text Field

For translatable text field, use translatable_text as field type.

Example

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' );

Contributing

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

Bugs

If you have encountered a bug, please use Github Issues to submit a an issue.

Submitting a Pull Request

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.

  1. Fork this repository
  2. Create a new branch from master
  3. Commit your changes
  4. Push to the newly created branch
  5. Submit a pull request
  6. Sit back, relax, and wait for a response 😃

TODO

  • Add plugin to wordpress.org
  • Add this package to wpackagist.org
  • Add more translatable fields (TextArea, RichText)

License

This project is licensed under GPLv3. Please read the LICENSE file for details.