garung/custompostype

Create custom post type for wordpres

1.1 2017-05-11 15:55 UTC

This package is not auto-updated.

Last update: 2024-11-24 03:55:57 UTC


README

Custom post type

Description: Create simple Custom Post Type for wordpress

Parameters:

DEMO
/**
 * Class handle for Product Custom Post Type
 */
class ProductCustomPost
{
    public function __construct()
    {
        $fields = [
            'posttype'          => 'product',
            'posttype_label'    => 'Sản Phẩm',
            'posttype_singular' => 'Sản Phẩm',
            'posttype_slug'     => 'product',
            'taxonomy_type'      => 'category-product',
            'taxonomy_label'     => 'Categories',
            'taxonomy_singular'  => 'Product Category',
            'taxonomy_slug'      => 'category-product',
        ];
        new CustomPost($fields);
    }
}

Note important: After create custom post type successful, you need update permalink by: Setting => permalink