As Mark explained, you will need to return $newvar. That should work. Also, please reset the permalink once. (I mean, go to Permalinks section in dashboard and click ‘Save changes’ button without making any changes. It will flush rewrite rules and build them again.)
If it still does not work, then I think below snippet may help. Check if that works. I found it here
add_filter('eventon_register_post_type_ajde_events', 'fix_event_slug', 10, 1);
function fix_event_slug($arr){
$new_ar = array('rewrite' => array('with_front'=>false, 'slug'=>'events'));
return array_merge($arr, $new_ar);
}
After adding above section, please reset the permalinks.
Related Posts:
- How to call a plugin function from index.php
- Rewriting every url
- Change post permalink to external URL from custom field
- Prevent page slug from interfering with custom post type archive permalink?
- Passing URL parameters to WordPress pages and pretty url
- Change Permalinks Structure to a Sequential Number for Each Post?
- Publish Post After Click On A Link
- How to prefix `attachment` permalinks with `attachment`?
- Alter post slug by a filter that is fired just after a post is created
- How to get the custom page get_permalink?
- WP get_permalink Return Wrong URL
- How to add nofollow on all external links without plugin?
- Custom url structure for custom template
- How do I customize my WordPress shortlink structure in link-template.php without a plugin?
- Add a Custom Permalink option in the Permalink Admin Screen?
- Social sharing post’s shortlink instead of permalink
- How to get the permalink of a page when loading my plugin
- Mixed unrelated taxonomy in permalink
- Rewrite url without flushing the database?
- How do I add a custom sub menu menu under Woo-commerce marketing?
- Changed permalink structure. Need help with redirecting old posts
- Change permalink structure hidden button edit
- Load custom PHP on a custom URL via a plugin
- How to change custom post type pemalink Hierarcy
- Plugin appends ugly URL string to index
- How to make a proper custom post type link
- Pagination Broken on Static Pages but Works on Blog Articles
- AddToAny shortcode in the loop
- ‘No Results Found’ on single post for custom post type
- Outbound link autometic converted into linkdirect , and not opening
- Is it possible to use multiple post_name, post_title and post_content?
- Modifying Author Link to add Author Meta in URL
- SEO Friendly URL on dynamic product page produced via shortcode
- Change permalinks of custom post type ‘question’ as post id or any random number once
- Remove /product/ from url. I want only category name then product name
- Customize permalink wordpress category id
- Reoccurring 404 Errors on all subpages
- Permalinks stopped working after migration with WP all-in-one migration plugin
- How to remove custom post type and add category and post name
- Perform internal redirect in WordPress?
- Using arbitrary paths in page urls
- “Custom Post Type Permalinks” plugin URL strcuture
- Filtering get_permalink in Jetpack / ShareDaddy
- Custom Permalink Plugin and Current Page/Ancestor in Menus
- plugin links not working [closed]
- Plugin generated taxonomies’ permalinks with custom placeholders
- How to get the permanent link in a plugin?
- This WordPress plugin isn’t creating links correctly
- rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked
- flush_rewrite_rules() not working with update_option_{$option}
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- Plugin not working & permalink erorr after upgrade to php 7x on Nginx
- Disable plugin If slug contains specific word
- How do I create a custom permalink structure for a page template
- I want to filter my products with attributes [closed]
- How to embed a new string in url?
- Make get_permalink() work outside the Loop using filters
- Plugin for TinyMCE to create reference to other posts
- Permalinks and pagination are not working in WordPress with WP e-Commerce plugin
- help intercepting save_post through plugin
- TranslatePress | secondary language category/sub-category not working correctly “`/%category%/%postname%/“`
- Why the internal link get converted into a comment?
- Oops! That page can’t be found
- Error in Fetching Custom Post Type parent Category URL (slug)
- Hidden permalink different from displayed permalink
- WordPress Frontend Page using Plugin
- Child theme modifications not showing up
- Rewrite/Change custom taxonomy slug
- Create new page in wordpress plugin which doesn’t exist
- one url for all pages
- Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin
- How to update all in-site redirect URLs to destination URLs at once
- post id or permalink auto-incrementing number and reset everyday
- Category Arabic Slug shows as symbols in plugin lists
- Custom author page for custom role
- Custom role not listed
- Members-only page, but accessible via sharable link
- added code to permalink (URL)
- How to setup same post slug for different categories?
- How to add add blank non-editable wp page like default blog for use with plugin
- Is it possible to change plugin’s Admin Panel Url?
- get_permalink is causing a whitescreen
- Share on social media created listing after submission
- Rogue splash page keeps popping up
- Coming soon pages with rest of site in maintenance mode
- How to disable wordpress page rewrite rule?
- How to programatically create a simple HTML page using the permalink of a WordPress post?
- How to maintain WordPress permalink structure with custom content with URL parameters?
- Change post permalink to external URL from custom field
- Unwanted Links and Spam WordPress Pages and Posts
- homepage olderposts link showing page not found
- 404 not found problem with URL rewrite custom category
- Adding Category in URL in some post
- Does anyone have the Custom Post Permalinks plugin from John P. Bloch? [closed]
- How to remove site name (https://exp.com/) from WORDPRESS site source links or file load url
- WordPress Plugin and other pages not opening
- 404 Error on a WordPress Website, Error disappears for a while and again appears
- claim a permalink and all sublinks in plugin
- Getting 400 Error in wordpress website
- Changing the “OT Process” Plugin’s Default Slug of /process/