You can omit the “base”, by adding
rewrite => array(
slug => 'item',
with_front => false,
),
Don’t forget to flush your rewrite rules after you changed that. The easiest way to do so it to simply visit the “admin > settings > permalinks” page.
If you need to add that to an already registered post type, then take a look at the internals of register_post_type()
and the available hooks and filters in its source Link to GitHub: Make use of the registered_post_type
action which comes with two arguments: $post_type
and $args
.
Related Posts:
- how to change the verification url of pie register plugin of wordpress?
- add_rewrite_rule to load different page, without changing URL in browser
- WordPress rewrite rule depend on meta values not ids
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- Change custom rewrite rule when permalink is updated/changed
- How to build an API as a plugin
- category_name not working (not showing up in sql query debug)
- How can I make my custom shortcode work in a Custom HTML Widget?
- add_rewrite_rule, plugin activation and plugin deactivation
- Update Multiple Post Meta for the Same Post In One call?
- WordPress Hook that will run when media file deleted
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- Post source link plugin – small modification
- Which hook callback has priority if both plugin and theme use the same hook?
- Add .html extension to custom post type taxonomies
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- How can I make the “Preview Post” button save and preview in the same window?
- Escape special characters in image link
- Cannot run the code after I activate the plugin
- Displaying admin notice dynamically
- Calling a plugin in theme development
- Unable to activate wordpress importer after installing it
- Get total number of comment of the posts written by an author
- WordPress Ajax Callback
- printf – problem to understand code
- Best way to hook a custom url?
- Auto delete WordPress users according to time
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- How to Create a Custom Plugin Permalink
- add_query_arg not working
- Theme my Login plugin, how to update fields
- How would I go about creating a user ranked post popularity page?
- WordPress: PHP code rendering in the wrong place
- New to wordpress, Question about editing PHP
- How to edit content before post update
- Rewrite rule not matching
- Customize permalink wordpress category id
- Take input from form and pass it to function using a wp-plugin
- Load Javascript from Plugin in One Page Only?
- Why is one phpunit test throwing an error on one class when all other classes are similar without error?
- WordPress call_user_func_array() expects parameter 1 to be a valid callback, class
- Why is my custom post type not being activated on plug-in activation?
- Setting Up PHP Workflow in WordPress
- What happens when WordPress memory limit is exceeded?
- How can I exclude a dynamic URL to show a popup created using ‘WordPress Popup’ plugin
- iframe not showing in post (with “allow php in posts” plugin activated)
- how can I do something on new user registration?
- Any idea how to get something like this to work? [closed]
- wp_dequeue_script for a Plugin
- Built a second plugin but it overwrote the first one
- WordPress: Add custom add_filter for custom functions
- Way to send multiple values for column to MySQL?
- How to change layout of shop page in wordpress? [closed]
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- preg_replace() No ending delimiter ‘.’ found [closed]
- Categories from front-end, checkbox selection doesn’t work
- Can you echo PHP code from a variable?
- How to fix these PHP Warnings with the “Feed JSON” plug-in?
- Dynamic URL Rewrite for Custom
- Conditional delete metadata does not works
- How can I adjust my function so the page editor still loads in the backend?
- Calling PHP function with AJAX
- Submitting form to PHP
- Looping the data from WordPress database using foreach
- Rename a folder via HTML POST request
- WordPress plugin blog creation
- Modifying server’s response to API endpoint
- Change Jobs for WordPress templates
- Defining constant in a plugin to use in another plugin
- Failed to load resource: the server responded with a status of 500 () post.php
- WordPress filter from custom table is not working properly
- user specific private content
- submit form data to wordpress existing database table using my plugin
- Custom SportsPress list
- Adding link for logged in user? [closed]
- Rewrite in plugin
- Create csv file in plugin
- How to copy data from user profile page (profile.php) to theme customizer
- Custom shortcode with dynamic rewrite
- Changes required to make new plugin from existing
- Metabox Data not saving
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- URL Rewriting from a Plugin based on custom values
- Xml output not places where i want
- Including a PHP file via a function that is part of a plugin?
- How do I output user_registered time in my correct timezone?
- How to fix ‘Call to undefined function do_settings()’ error?
- how to search through plugin in wordpress cimy-user-extra-fields?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Translate text for empty product
- Passing an input variable through a switch statement
- How to rewrite URL using .htaccess in WordPress Plugin
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Posts in Admin only display 1 Post instead of all Post in admin area
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Creating a Table Row by Row
- Getting 504 Gateway Timeout Error on AWS Server! [closed]
- WordPress issue – data is not showing in wp-admin, but when searching through database, all the data is there
- WordPress Throwing Deprecated Errors on its own Files
- plugin doesn’t retrieve data from database