I have multiple custom post types, but one gives an Internal Server Error.
This is my code:
add_action( 'init', array( __CLASS__, 'register_post_types' ), 2 );
public static function register_post_types() {
if ( post_type_exists('wpcm_player') )
return;
do_action( 'wpclubmanager_register_post_type' );
register_post_type( 'wpcm_club',
apply_filters( 'wpclubmanager_register_post_type_club',
array(
'labels' => array(
'name' => __( 'Clubs', 'wpclubmanager' ),
'singular_name' => __( 'Club', 'wpclubmanager' ),
'add_new' => __( 'Add New', 'wpclubmanager' ),
'all_items' => __( 'All Clubs', 'wpclubmanager' ),
'add_new_item' => __( 'Add New Club', 'wpclubmanager' ),
'edit_item' => __( 'Edit Club', 'wpclubmanager' ),
'new_item' => __( 'New Club', 'wpclubmanager' ),
'view_item' => __( 'View Club', 'wpclubmanager' ),
'search_items' => __( 'Search Clubs', 'wpclubmanager' ),
'not_found' => __( 'No clubs found', 'wpclubmanager' ),
'not_found_in_trash' => __( 'No clubs found in trash'),
'parent_item_colon' => __( 'Parent Club:', 'wpclubmanager' ),
'menu_name' => __( 'Clubs', 'wpclubmanager' )
),
'hierarchical' => false,
'supports' => array( 'title', 'thumbnail' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => false,
'menu_icon' => 'dashicons-shield',
'publicly_queryable' => true,
'exclude_from_search' => true,
'has_archive' => false,
'query_var' => true,
'can_export' => true,
'rewrite' => array( 'slug' => 'klub' ),
'capability_type' => 'post'
)
)
);
register_post_type( 'wpcm_player',
apply_filters( 'wpclubmanager_register_post_type_player',
array(
'labels' => array(
'name' => __( 'Players', 'wpclubmanager' ),
'singular_name' => __( 'Player', 'wpclubmanager' ),
'add_new' => __( 'Add New', 'wpclubmanager' ),
'all_items' => __( 'All Players', 'wpclubmanager' ),
'add_new_item' => __( 'Add New Player', 'wpclubmanager' ),
'edit_item' => __( 'Edit Player', 'wpclubmanager' ),
'new_item' => __( 'New Player', 'wpclubmanager' ),
'view_item' => __( 'View Player', 'wpclubmanager' ),
'search_items' => __( 'Search Players', 'wpclubmanager' ),
'not_found' => __( 'No players found', 'wpclubmanager' ),
'not_found_in_trash' => __( 'No players found in trash'),
'parent_item_colon' => __( 'Parent Player:', 'wpclubmanager' ),
'menu_name' => __( 'Players', 'wpclubmanager' )
),
'hierarchical' => false,
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'menu_icon' => 'dashicons-groups',
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => false,
'query_var' => true,
'can_export' => true,
'rewrite' => array( 'slug' => 'jatekos' ),
'capability_type' => 'post'
)
)
);
}
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]
First is work, second doesnt.
###
Work: domain.com/klub/klubname
Not work: domain.com/jatekos/jatekosname
###
How can I fix it?