Entities - nikonorovsv/wpf GitHub Wiki

Using Entities is a way to create your own post types and taxonomies in WPF. Created Entities implements of IEntities interface and should to be located at /app/entities directory. They will be processed by the EntityDefiner observer. It's enabled by default. They As example:

namespace app\entities;

use wpf\wp\Taxonomy;

class Genre extends Taxonomy
{
	const NAME = 'genre';

	public function __construct() {
		$this->args = [
			'labels'            => self::getLabels(),
			'hierarchical'      => true,
			'show_ui'           => true,
			'show_admin_column' => true,
			'query_var'         => true,
			'rewrite'           => array( 'slug' => 'genres' ),
		];

		$this->deps = ['book'];
	}

	public static function getLabels() {
		return [
			'name'              => _x( 'Genres', 'taxonomy general name', 'textdomain' ),
		    'singular_name'     => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),
		    'search_items'      => __( 'Search Genres', 'textdomain' ),
		    'all_items'         => __( 'All Genres', 'textdomain' ),
		    'parent_item'       => __( 'Parent Genre', 'textdomain' ),
		    'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),
		    'edit_item'         => __( 'Edit Genre', 'textdomain' ),
		    'update_item'       => __( 'Update Genre', 'textdomain' ),
		    'add_new_item'      => __( 'Add New Genre', 'textdomain' ),
		    'new_item_name'     => __( 'New Genre Name', 'textdomain' ),
		    'menu_name'         => __( 'Genre', 'textdomain' )
		];
	}
}