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
- Update Option Stored in Multi-Dimensional Array
- check if Gutenberg is currently in use
- WordPress Plugin Development – Headers Already Sent Message
- Get page content using slug
- How to include wp-load.php from any location?
- Correct way to enqueue jquery-ui
- How to echo the_excerpt without the P tag wrapper?
- How can I update a wordpress plugin from a Git repository (github)
- Is There a Plugin Life Cycle Documentation?
- $wpdb->insert_id
- Remove profile picture option (and other things) from profile.php (in admin)
- How to disable plugin update notification for a specific plugin in Multisite
- Getting old term value with edited_{$taxonomy} | Hook
- Building a better media uploader for WordPress
- Problems with localization
- Install and load additional plugins when running unit tests
- Calling clean_term_cache() fails when called in the same plugin that creates terms, succeeds when called separately?
- Singular name Plugin localization
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- On plugin deactivation hide its shortcode
- Can I submit a plugin that follows the PSR-2 coding style guide?
- How to get current page id through the plugin
- Properly licensing a plugin that uses Apache 2.0 licensed code
- How to restrict plugin’s sub-menu pages to admin/subscribers?
- Can I dynamically create a link to my plugin settings/options page from my plugin description?
- Saving data from block editor to the database
- Cannot search post by taxonomy
- OOP Plugin and Menu – Call to undefined function register_setting()
- Will current_theme_supports return TRUE with a nonstandard add_theme_support?
- How to untrash a post only if it was not a draft?
- Act on user meta updated, but only once
- get_pages Drop down list for selection of a page
- Display content from custom post without modifying the single template
- How do I add custom column to woocommerce cart?
- WordPress mode for emacs?
- Calling is_single() outside the loop
- update woocommere total value on checkout based on selected payment method
- Loading WordPress Admin Environment
- how to add custom functionality after woocommerce place order button
- Problems with: manage_${post_type}_posts_columns
- Make WordPress cache permanent for some pages until edited
- Getting timestamp of activation plugin time
- Rich text editor settings persist throughout all rich text editors
- Function: Add link to / inside div
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- WP Gutenberg Blocks – How to limit first/root blocks
- How do I update a field of a meta box?
- Following WordPress Markup Is mandatory, got awkward resultyby wordpress standard markup?
- How to Get Current Custom Post Type Associated Taxonomy Term
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- Are there any official or unofficial guidelines for the styling of a widget?
- How to get error object returned by wp_create_user
- Logout after clicking URL link results in “headers already sent” error
- My WordPress Plugin code breaks customize.php viewpoint
- Custom filter not working
- Make wordpress join default user metas with a column from another table while displaying the wp_users table on the users screen
- ajax working when function is on child theme but not in plugin page
- I need to refresh page to display wp_get_current_user() : why?
- $wpdb->prepare is not working like mysql_real_escape_string
- Adding Dynamic Stylesheet
- Enqueue ONLY Plugin Styles and Scripts
- Foreign wp_users ID in custom plugin DB table?
- Metabox is not displaying
- How to do admin ajax request in a plugin for rest api
- How to show comments from different Plugins to same post type?
- Proper way to do a page view count on a page?
- Catching a GET parameter from the URL and save it in the user meta when a user registers
- The plugin generated 683 characters of unexpected output during activation
- admin-post.php form handling only working when logged in as admin
- WP_Query not ordering correctly
- Dont display post with no content
- Custom User Role Preview Function Not Working
- Custom Admin Plugin – Injecting repeatable select fields (add, remove) into an Ordered List
- Error when activating a custom plugin on production server
- React in plugins: REST endpoints vs. regular functions
- Post Pagination does not working on WP-Query
- Publish, Save Draft and Preview buttons do not work after being moved with jQuery
- I can’t write in my DB using $wpdb->insert
- woocommerce single product page hook not working
- How do I build a settings panel under the plugin
- Multiple Users Logged In Causing Incorrect Account Returned
- Displaying $_FILES data (simlar to $_POST)
- How do I replace title with my plugin?
- Create pages for authors
- Enqueue Script in custom plugin before other
- How to remove a class [closed]
- How can I dynamically change title and description in WordPress?
- Remove Gutenberg Buttons Block