<?php
/*
Plugin Name: Explain my bug
Plugin URI: http://wordpress.org
Description: Bug proof.
Author: Amaury Balmer
Version: 0
Author URI: http://beapi.fr
*/

// 1. Register a custom post type
add_action('init', 'register_my_cpt');
function register_my_cpt() {
	register_post_type( 'test', array(
		'public'  => true,
		'capability_type' => 'post',
		'map_meta_cap' => true,
		'hierarchical' => false,
		'rewrite' => false,
		'query_var' => false,
		'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),
		'menu_position' => 25 // Bug with the value 25 and 26
	) );
}

// 2. Add menu with the function add_object_page()
add_action('admin_menu', 'update_menu_admin');
function update_menu_admin() {
	add_object_page('My Menu', 'My Menu', 'manage_options', 'my-menu', 'my_page');
}
function my_page() {
	echo 'Hello world';
}

// 3. See the menu, you will see that the post type test is overwrite by the custom menu.
?>