You’re recieving this error because WordPress notices the post_type query argument and that sampletype is a valid registered post type, and thinks you’re on an edit page. Try using a different query arg then post_type.
Note that admin.php?page=plugin-slug-posttypes-add&post_type=thisisnotaposttype and admin.php?page=plugin-slug-posttypes-add&foo=bar will both work fine.
Related Posts:
- add_menu_page() with different name for first submenu item
- Plugin – create a page without it appearing in the side menu
- How to add more than 1 user role to sub-menu pages
- Odd behaviour with submenu link creation
- How to avoid creating first submenu page that is same as menu page?
- Sub Menu content is being duplicated
- Is there documentation reference for forms in menu and setting pages?
- Why won’t this submenu page show? – My First WordPress Plugin
- How to create a custom post-new.php page for plugin , no wp menu
- Add a custom submenu under submenu in a Custom WordPress Plugin
- Add Admin menus or submenus depending on conditions
- edit-tags.php in plugin admin menu hides when is the active page
- Custom database table entry edit page
- Admin adding submenu that has the same destination as the parent menu
- How to include jQuery and JavaScript files correctly?
- $_POST form request with admin-post
- How can I configure Docker for developing and deploying a custom theme?
- How do I log plugin (cron) actions?
- How can I run AJAX on a button click event?
- What is the difference between using global $current_screen and get_current_screen()?
- Adding pre-publish checks with Gutenberg
- How Do I Make WordPress Run an Event Every Day?
- How can I change the frequency of a scheduled event?
- How to filter $post->post_content prior to save
- How to get data from WordPress $wpdb into React Gutenberg Blocks Frontend?
- How to check if certain plugin exists and in expected version
- How to add SQL file with PHP to WordPress database [closed]
- array_map() for sanitizing $_POST
- Is there a faster way than wp_insert_post to add content to a blog
- How to include external library in wordpress plugin
- Delete a specific item menu when I deactivate my plugin
- Platform/Website that Supports Crowd-Funded WordPress Projects? [closed]
- Get user id for delete and update selected user
- How can I call template partials inside my custom plugin
- Decrease RSS cache time in plugin?
- Add version query tag to all images
- Creating table with plugin is not working
- How to store a medium amount of options?
- How to delete an user including data from custom database tables
- Add custom element ID depending where the widget place is, sidebar or footer
- My plugin class doesn’t work! [closed]
- Beginner advice
- Woocommerce checkout update totals with datepicker
- Multiple options pages validation for a plugin
- rewrite URL based on selected taxonomy for post page
- Woocommerce – Convert Delivery method into a custom field
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- get_option() not returning expected value from plugin
- Woocommerce Composite Products – Add a composite product to cart programmatically via ajax [closed]
- Testing Rewrite Rules with PHPUnit
- Add a page in admin without adding menu item
- Including third party libraries in plugin [closed]
- Possible to get all posts with my shortcode?
- Avoid updating post when sending POST or GET request to post.php
- should i be checking for jquery before enqueing it in a plugin
- WordPress Specified file failed upload test
- WordPress theme options Menu
- Add information to HTTP Header in WordPress Plugin
- Catching Gutenberg sidebar switch event
- Can’t retrieve body params from PUT endpoint using formdata
- enabling Twig as Template Engine withing own plugin [closed]
- Converting data-name editor plugin to Gutenberg plugin
- Set _regular_price 0 if empty in woocommerce product
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- Writing editor content to a file
- $wpdb in php 5.5
- how to display a string in admin_notices hook from a class plugin
- Create an user on external database
- How to Find a Gallery’s ID
- WP 3.3 makes it possible to add meta box to Category Editor Screen?
- Widget internal hooks and functions
- Why does website stretch and white space on load? [duplicate]
- How to create a custom wordpress plugin
- Undefined cache functions in my custom plugin
- Twenty-seventy theme remove additional CSS from head
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Nested Hooks with do_action for performance reasons – safe/necessary?
- Replace the WordPress Media Library Uploader
- do_action from within a class does not seem to work
- WordPress delete mysql rows with string
- Select field value not returned after saving changes
- WP Query Relations / Compare
- Page template compatibility with different themes
- WordPress Plugin: OSCommerce images not displaying in front end
- Implementing plugin with HTML/CSS form?
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- How do I store a custom dataset in WordPress to best take advantage of API?
- add short code not working
- how can I insert a link on login page
- Shortcode attribute “title” doesn’t appear in $atts array
- What’s wrong in the WordPress Meta Box Generator code?
- add category id to option name when adding an option on edit_category
- esc_url, esc_url_raw or sanitize_url?
- React Plugin Settings Page Localization
- Is it within WordPress guidelines to update another plugin’s database fields from my own plugin? [closed]
- Block Development: hamburger module throwing error in save function
- 2 Domains pointing to SIngle WordPress , issues with links
- How can I space out images when adding to a post without HTML/CSS/JS?
- How to apply a javascript code on certain parts of elementor made pages?
- Hide menu items from not logged in users