product post type
product post type
// Register Custom Post Type
function product_post_type() {
$labels = array(
'name' => _x( 'المنتجات', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'منتج', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'المنتجات', 'text_domain' ),
'parent_item_colon' => __( 'منتج رئيسى : ', 'text_domain' ),
'all_items' => __( 'كل المنتجات', 'text_domain' ),
'view_item' => __( 'عرض', 'text_domain' ),
'add_new_item' => __( 'اضف منتج جديد', 'text_domain' ),
'add_new' => __( 'اضف جديد', 'text_domain' ),
'edit_item' => __( 'تعديل', 'text_domain' ),
'update_item' => __( 'تحديث', 'text_domain' ),
'search_items' => __( 'بحث المنتجات', 'text_domain' ),
'not_found' => __( 'لا يوجد', 'text_domain' ),
'not_found_in_trash' => __( 'لا يوجد فى سله المحذوفات', 'text_domain' ),
);
$args = array(
'label' => __( 'product', 'text_domain' ),
'description' => __( 'Product Post Type', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-screenoptions',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'product', $args );
}
// Hook into the 'init' action
add_action( 'init', 'product_post_type', 0 );