Попробуйте посмотреть код ниже и поместите свою версию в файл functions.php. Это должно работать отлично. Возможно, вам придется заменить «и» апострофами.
add_action(‘init’, ‘product_register’);
function product_register() {
$args = array(‘label’ => __(‘Products’), ‘singular_label’ => __(‘Product’), ‘public’ => true, ‘show_ui’ => true, ‘capability_type’ => ‘post’, ‘hierarchical’ => false, ‘rewrite’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’));
register_post_type(‘product’, $args);
}
add_action(“admin_init”, “admin_init”);
add_action(‘save_post’, ‘save_price’);
function admin_init() {
add_meta_box(“prodInfo - meta”, “Product Options”, “meta_options”, “product”, “side”, “low”);
}
function meta_options() {
global $post;
$custom = get_post_custom($post - > ID);
$price = $custom["price"][0];
echo‘ < label > Price: < /label><input type=”text” name=”price” value=”‘. $price .’” / > ’;
}
function save_price() {
global $post;
update_post_meta($post - > ID, “price”, $_POST["price"]);
}
// custom table columns
register_taxonomy(“catalog”, array(“product”), array(“hierarchical” => true, “label” => “Catalogs”, “singular_label” => “Catalog”, “rewrite” => true));