Parse error: syntax error, unexpected ‘register_post_type’ (T_STRING), expecting ‘)’
Question
<?php
/*
Plugin Name: Products
Plugin URI: https://www.pivolet.com/
Description: This plugin creates a custom post type for products with custom fields and taxonomies.
Version: 1.0
Author: saqlain riaz
Author URI: https://www.pivolet.com/
License: GPL2
*/
// Register Custom Post Type
function custom_products_post_type() {
$labels = array(
'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Product', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Products', 'text_domain' ),
'name_admin_bar' => __( 'Product', 'text_domain' ),
'archives' => __( 'Product Archives', 'text_domain' ),
'attributes' => __( 'Product Attributes', 'text_domain' ),
'parent_item_colon' => __( 'Parent Product:', 'text_domain' ),
'all_items' => __( 'All Products', 'text_domain' ),
'add_new_item' => __( 'Add New Product', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'new_item' => __( 'New Product', 'text_domain' ),
'edit_item' => __( 'Edit Product', 'text_domain' ),
'update_item' => __( 'Update Product', 'text_domain' ),
'view_item' => __( 'View Product', 'text_domain' ),
'view_items' => __( 'View Products', 'text_domain' ),
'search_items' => __( 'Search Product', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
'featured_image' => __( 'Featured Image', 'text_domain' ),
'set_featured_image' => __( 'Set featured image', 'text_domain' ),
'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
'use_featured_image' => __( 'Use as featured image', 'text_domain' ),
'insert_into_item' => __( 'Insert into Product', 'text_domain' ),
'uploaded_to_this_item' => __( 'Uploaded to this Product', 'text_domain' ),
'items_list' => __( 'Products list', 'text_domain' ),
'items_list_navigation' => __( 'Products list navigation', 'text_domain' ),
'filter_items_list' => __( 'Filter Products list', 'text_domain' ),);
$args = array(
$args = array(
'label' => __( 'Product', 'text_domain' ),
'description' => __( 'Product Description', 'text_domain' ),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'product' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'menu_position' => 5,
'menu_icon' => 'dashicons-cart',
'supports' => array( 'title', 'editor', 'thumbnail',
'custom-fields', 'comments', 'excerpt' ),
'taxonomies' => array( 'product_brand', 'product_category')
register_post_type( 'product', $args );
}
add_action( 'init', 'create_custom_post_type' );
?>
0
4 weeks
2023-03-03T13:33:51-05:00
2023-03-03T13:33:51-05:00 0 Answers
0 views
0
Leave an answer