jjgrainger / wp-custom-post-type-class

A PHP Class for creating Wordpress Custom Post Types easily
MIT License
416 stars 114 forks source link

Add ability to use different grammatical forms on translations. #52

Closed villeristi closed 1 year ago

villeristi commented 8 years ago

Especially useful in weird languages like Finnish...

e.g.

$books = new CPT( [
    'post_type_name'   => 'books',
    'singular'         => _x( 'Book', 'Single', 'textdomain' ),
    'plural'           => _x( 'Books', 'Plural', 'textdomain' ),
    'partitive'        => _x( 'Book', 'Partitive', 'textdomain' ),
    'partitive_plural' => _x( 'Books', 'Partitive plural', 'textdomain' ),
    'slug'             => 'books'
] );
$books->register_taxonomy( [
    'taxonomy_name'    => 'topic',
    'singular'         => _x( 'Topic', 'Single', 'textdomain' ),
    'plural'           => _x( 'Topics', 'Plural', 'textdomain' ),
    'partitive'        => _x( 'Topic', 'Partitive', 'textdomain' ),
    'partitive_plural' => _x( 'Topics', 'Partitive plural', 'textdomain' ),
    'slug'             => 'topic'
] );