Before flashing rules you have to add them:
public function activate() {
$this->add_rewrite_rules();
flush_rewrite_rules();
}
Related Posts:
- rewrite URL based on selected taxonomy for post page
- add_rewrite_rule behaving strangely
- How to Rewrite WordPress URL for a Plugin
- Rewrite url for existing page without flush_rewrite_rules
- URL rewriting must be activated manually for my plugin
- How to change the URL pattern for single post view
- How To Consistently Enforce Rewrite Rule in Plugin Development
- Help With Rewrite_Rules For a Custom Plug-In
- Adding rewrite rule dynamically
- Problem with dinamic add_rewrite_rule()
- Remove custom post type slug from URL and add taxonomy Slug
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- How can I add rewrite rules to a class-based plugin?
- configuration of .htaccess for add_rewrite_rule to make sense
- Forward an old url rewrite scheme to a new one?
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- Custom post type change permalink query
- Add variables from rewrite rules to query var
- Using meta_key & meta_value in add_rewrite_rule
- Any way to make Apache’s internal redirect work?
- Custom slug in url for CPT and taxonomy
- add_rewrite_rule not working
- How to Rewrite WordPress URL for a Plugin
- Virtual Page with Registration form
- How to use permalink query to go to specific tabs in posts
- How to Rewrite WordPress URL for a Plugin
- URL rewrite parameter lost (add_rewrite_rule)
- Custom rewrite, url path with parameters to a page
- A tool to analyze rewrite rules? [closed]
- Need help with add_rewrite_rule
- remove “index.php” from permalinks
- Custom pages with plugin
- Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Custom rewrite rules for archive page and single post
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom post type permalink endpoint
- Making a plugin file accessible via url rewrite?
- Multiple post types – share same ReWrite slug?
- Add rewrite rule to permalink structure
- Custom frontend page for plugin without a ‘physical’ page?
- How to add a custom URL placeholder to author archives?
- How to modify URL structures in custom post types and taxonomies or terms
- Adding meta values to permalink
- add_rewrite_rule, plugin activation and plugin deactivation
- Removing taxonomy base using WP rewrite
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Make post slug have priority over category slug
- Permalinks so that one custom post type appears to be a child of another, not working
- Custom taxonomy on permalink
- permalinks with get variables
- WordPress plugin how to run function when button is clicked
- Custom Rewriting to Plugin with Parameters
- Plugin to Consume a Web Service
- Permalink rewrite with custom post type and custom taxonomy
- Filter to change the content of 404 page
- Prepend meta_value to permalink of post
- Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions
- Removing rules from .htaccess
- Mapping multiple URLs to same page
- Using two permalinks for one post
- flexible rewrite ‘ramble’ URLs with WordPress
- Permalinks for CPT breaks permalinks to pages
- WP Rewrite Rules – Custom post type & taxonomy
- Use an empty page to build custom plugin output
- Remove base slug in CPT & CT, use CT in permalink
- Change the custom post type permalink
- External Rewrite Rules
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Rewrite url / permalink for default archive – yearly / monthly
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Does flush_rewrite_rules() remove all rules added by other plugins as well as mine?
- Add_rewrite_rule doesn’t add custom url in plugin
- Add Post and Comments menu no longer visible
- WordPress Rewrite rule for nested post types
- Does WP Have a Function To Generate .htaccess RewriteCond?
- Permalinks, Rewrites, Get Variables, Oh My!
- Creating a path in a plugin to call a function
- Change permalink for a single post entry
- Custom rewrite rule serves content, but returns 404 error code
- How to Modify Existing Rewrite Rules?
- Custom Permalink Tag breaks Pagination
- Add parent/child taxonomy to custom post type url
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- flush_rewrite_rules() not working on plugin activation
- custom permalink/shortlink with base62 encoded post ID
- Custom Permalink for Taxonimie and Custom Post Type
- Add specific word to default page permalink
- 404 errors after plugin options update and category base change
- How to restore WP 5.4 behaviour where a numeric string could added to each page URL and parsed as “page” in WP 5.5?
- redirect word-press page with page values
- WordPress add parameters with friendly url structure
- Add additional URL variations for a Post
- What is the best way to relate different custom post types?
- Cannot use dynamic prefix for WooCommerce permalink
- Remove slug of multiple custom post types with and without hierarchical
- Custom post permalinks for specific categories
- Pretty URLs for dynamically created product and pagination pages
- WordPress – Custom permalinks for advanced custom fields (ACF) using post type taxonomy