20/07
2017
Wallogit.com
2017 © Pedro Peláez
Create custom post type for wordpres
Custom post type, (*1)
Description: Create simple Custom Post Type for wordpress, (*2)
Parameters:, (*3)
DEMO , (*4)
/**
* 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