wordpress change custom post type slug

Solutions on MaxInterview for wordpress change custom post type slug by the best coders in the world

showing results for - "wordpress change custom post type slug"
Giovanni
21 Sep 2019
1function add_custom_rewrite_rule() {
2
3    // First, try to load up the rewrite rules. We do this just in case
4    // the default permalink structure is being used.
5    if( ($current_rules = get_option('rewrite_rules')) ) {
6
7        // Next, iterate through each custom rule adding a new rule
8        // that replaces 'movies' with 'films' and give it a higher
9        // priority than the existing rule.
10        foreach($current_rules as $key => $val) {
11            if(strpos($key, 'movies') !== false) {
12                add_rewrite_rule(str_ireplace('movies', 'films', $key), $val, 'top');   
13            } // end if
14        } // end foreach
15
16    } // end if/else
17
18    // ...and we flush the rules
19    flush_rewrite_rules();
20
21} // end add_custom_rewrite_rule
22add_action('init', 'add_custom_rewrite_rule');
23
queries leading to this page
custom post type slug name in wordpresswordpress custom post type url slughow to change custom post type slug in wordpresscustom post type slug in urlwordpress custom post type slugwp custom cpt adding post name by default in slugwordpress custom post type url slug pluginchange custom post type slug wordpresswordpress custom post type ui slughow to get custom posttype data with slug in wordpressadding custom post type slug in urlwp get post slug of custom post typeshow custom post type by slugwordpress view custom post type slugchange custom post type slughow to get custom post type slug in wordpresschange slug custom post wordpresschange custom post type slug pluginhow to change custom post type slugcustom post type slugrewrite post slug wordpresshow to get custom post type data with slug in wpbakerywp category slug on custom post typeslug attaching postname in custom post type wpgive slug according to field in wordpress custom post typewp category slug of custom post typecustom post type slug with categorywp custom post type slug change functionhow to get custom post type slug in wordpress orgcustom slug custom post type wordpresschange slug custom post typeslug of custom post typewordpress change url of custom post typecustom slug on save custom post typewordpress custom post type slug transalation functionshow to change custom post type url in wordpresscustom post type category slugwordpress rewrite slug custom post typewordpress custom post type name and slugwordpress change custom post type slughow to change url of custom post type wpwordpress change custom post typeget custom post type slugwordpress custom post type post slug vs idwordpress change custom post type namewordpress substitute page for custom post typewordpress change slug custom post typewp custom post type is adding post slug in slugchange slug wordpresscustom post type update slugchange slug for generic posts in wordpresshow to make custom fields in custom post type a slug for individual custom postcustom post slug for wordpress pagewordpress custom post type post not using slugcustom post type change slugset slugs to not apply to certain post types wordpresswordpres 3fpost type 3d change slugwordpress change post type slugwordpress custom post type plugin slugcustom post type slug wordpresschange slug of custom post typeupdate slug custom post typewordpress change custom post type slug