php – How to display “Trash” in my custom post type?

Question

what does it take to display the Recycle Bin in my own Custom Post Type?

function my_custom_post_specialist() {
    $labels = array(
      'name'               => _x( 'Terapeuci', 'post type general name' ),
      'singular_name'      => _x( 'Terapeuci', 'post type singular name' ),
      'add_new'            => _x( 'Dodaj nowego specjalistę', 'book' ),
      'add_new_item'       => __( 'Dodaj nowego specjalistę' ),
      'edit_item'          => __( 'Edytuj specjalistę' ),
      'new_item'           => __( 'Nowy specjalista' ),
      'all_items'          => __( 'Wszyscy specjaliści' ),
      'view_item'          => __( 'Pokaż specjalistę' ),
      'search_items'       => __( 'Szukaj specjalistów' ),
      'not_found'          => __( 'Nie znaleziono specjalisty' ),
      'not_found_in_trash' => __( 'Brak specjalistów w koszu' ), 
      'menu_name'          => 'Terapeuci'
    );
    $args = array(
      'labels'        => $labels,
      'description'   => 'Tutaj znajdują się wszyscy specjaliści.',
      'menu_position' => 4,
      'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'revisions' ),
      'taxonomies'    => array('areas', 'professions'),
      'has_archive'   => true,
      'menu_icon'     => 'dashicons-groups',
      'public' => false,  // it's not public, it shouldn't have it's own permalink, and so on
      'publicly_queryable' => true,  // you should be able to query it
      'show_ui' => true,  // you should be able to edit it in wp-admin
      'show_in_nav_menus' => false,  // you shouldn't be able to add it to menus
      'has_archive' => false,  // it shouldn't have archive page
      'rewrite' => true,  // it shouldn't have rewrite rules
    );
    register_post_type( 'specialist', $args ); 
  }
  add_action( 'init', 'my_custom_post_specialist' );

It only shows me Drafts, Publications etc, but no Recycle Bin.

Thanks

0
handzel 1 year 2022-03-17T09:29:03-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse