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 have custom post type and i want to echo the content of it in submenu page

like these

    <?php

function codex_custom_init() {
  $labels = array(
    'name'               => 'Books',
    'singular_name'      => 'Book',
    'add_new'            => 'Add New',
    'add_new_item'       => 'Add New Book',
    'edit_item'          => 'Edit Book',
    'new_item'           => 'New Book',
    'all_items'          => 'All Books',
    'view_item'          => 'View Book',
    'search_items'       => 'Search Books',
    'not_found'          => 'No books found',
    'not_found_in_trash' => 'No books found in Trash',
    'parent_item_colon'  => '',
    'menu_name'          => 'Books'
  );

  $args = array(
    'labels'             => $labels,
    'public'             => true,
    'publicly_queryable' => true,
    'show_ui'            => true,
    'show_in_menu'       => true,
    'query_var'          => true,
    'rewrite'            => array( 'slug' => 'book' ),
    'capability_type'    => 'post',
    'has_archive'        => true,
    'hierarchical'       => false,
    'menu_position'      => null,
    'supports'           => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
  );

  register_post_type( 'book', $args );
}
add_action( 'init', 'codex_custom_init' );


function bookf() {
    //Add Submenu Page
    add_submenu_page( 'edit.php?post_type=book', 'to edite Teams', 'EDite Teams', 'manage_options', 'bookf', 'bookout' );
}
add_action( 'admin_menu', 'bookf' );


function bookout() {

Echo "the content of book Custom post type same that show on all book : edit.php?post_type=book ";

}




?>
share|improve this question
    
Why? This looks like you are reproducing functionality that already exists. –  s_ha_dum Feb 18 at 0:27
    
@s_ha_dum because each of those will be with customized columns –  Azmy Feb 18 at 1:11
    
What do you mean by "those"? There is only one CPT there. It is not clear to me what you are doing but if you don't want to use the built-in interface you are going to have to create your own from scratch. That makes this pretty broad. –  s_ha_dum Feb 18 at 1:25
    
    
you don't understand me ?? okay in these code the label 'all_items' will show all items under these registered post type with these columns " title - author - date " But i want to show these items in another label with the column "title - thumbnail " only ... so i want these reproducing ... –  Azmy Feb 18 at 1:56

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.