Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want use register_post to get wordpress template for create my own post.

 $product_label = array(

  'name' => __('Products','neocom'),
  'singular_name' => __('Product','neocom'),
  'add_new' => __('Ajout d\'un nouveau produit','neocom'),
  'add_new_item'    => __('Ajout d\'un nouveau produit 2','neocom'),
  'new_item'    => __('Ajout d\'un new produit','neocom'),
  'edit_item'   => __('Edit produit','neocom'),
  'view_item'   => __('View product','neocom'),
  'all_items'   => __('Liste des produits','neocom'),
  'not_found'   => __('Pas de produits enregistré'),
  'menu_name' => __('My product name menu','neocom'),

);


register_post_type('product', array(
 'labels' => $product_label,
 'singular_label' => __('Product'),
 'public' => true,
 'show_ui' => true,
 'capability_type' => 'post',
 'show_menu_ui' => 'neo-product',
 'hierarchical' => false,
 'supports' => array('title', 'author', 'thumbnail')
));

I want to do appear List's product and New product and my own admin menu. I have added show_menu_ui => 'neo_product'. The result , i have my product list but haven't new product. I have defined admin_menu like it :

add_action('admin_menu',array($this,'buildMenuAdmin')); // On my constructor

buildMenuAdmin function :

 add_menu_page('NeoptinCom','Neo_Com',$capability,'neo-product',array(&$this,'neoproduct_all'));

 // Gestion page product & hook pour le css
    //Page product ( Liste )
    $product_page = add_submenu_page('neo-product', __('All Product','neocom'), __('Products','neocom'),$capability,'neo-product',array(&$this,'neoproduct_all'));
    add_action( 'admin_head-'.$product_page, array(&$this,'admin_header') );

// Page Creation/Modification de produit
$product_page_create = add_submenu_page('neo-product', __('Create Product','neocom'), __('Create Product','neocom'),$capability,'neo-product-create',array(&$this,'neoproduct_create'));
add_action( 'admin_head-'.$product_page_create, array(&$this,'admin_header') );
error_log('Page=> '.$product_page_create );
//Page paiement
$paiement_page = add_submenu_page('neo-product', __('Paiement','neocom'), __('Paiement','neocom'),$capability,'neo-paiement',array(&$this,'neopaiement'));
add_action( 'admin_head-'.$paiement_page, array(&$this,'admin_header') );
share|improve this question
    
Yes, i did it ! Thanks for your answer ;) –  Mepps Nov 9 '11 at 16:11

1 Answer 1

up vote 0 down vote accepted

Not sure where the issue is. You don't need all that extra code, just the first block of code, and you will have the list all and new product options within that menu item. I copied the first block of code you supplied and that alone works fine.

Changed from comment to answer.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.