Custom Post Type / page-parents
-
Hey guys,
I am having a little problem with my custom post type. I activated support for Page Parents and it was working quite well, but now (and I cant figure out why) some of the custom posts are not shown in the dropdown menu.
I already checked the corresponding functions like wp_dropdown_pages and I can say that my post is hierarchical (otherwise the functionality wouldnt work at all) and has page capabilities. I assume that wordpress isnt passing all posts to the wp_dropdown_pages function to begin with, and while that may be okay, I cant figure out what the conditions are for a custom post to be included in the list of possible parents. This is how I initialized the custom post:
/* Post Type registrieren */ function kollektion_cpt() { $labels = array( 'name' => __( 'Kollektionen' ), 'singular_name' => __( 'Kollektion' ), 'add_new' => __( 'Kollektion hinzufügen' ), 'add_new_item' => __( 'Kollektion hinzufügen' ), 'edit_item' => __( 'Kollektion bearbeiten' ), 'new_item' => __( 'Kollektion hinzufügen' ), 'view_item' => __( 'Kollektion ansehen' ), 'search_items' => __( 'Kollektion suchen' ), 'not_found' => __( 'Keine Kollektion gefunden' ), 'not_found_in_trash' => __( 'Keine Kollektion im Papierkorb gefunden' ), 'parent_item_colon' => __( 'Elternkollektion' ), 'all_items' => __( 'Alle Kollektionen' ) ); $supports = array( 'title', //Kollektionsname 'thumbnail', //Thumbnail-Bild 'excerpt', //Auszug 'editor', //Haupttext - Kollektionsbeschreibung 'page-attributes' //Für die Hierarchie, damit man Kategorien anderen Kategorien zuordnen kann. ); $args = array( 'labels' => $labels, 'public' => true, 'supports' => $supports, 'hierarchical' => true, 'rewrite' => true, 'capability_type' => 'post' ); register_post_type( 'kollektion', $args ); } add_action( 'init', 'kollektion_cpt' );
The topic ‘Custom Post Type / page-parents’ is closed to new replies.