You learned in the Custom Post Type Basics lab that you need to flush the rewrite rules when registering a custom post type. You need to do it for a custom taxonomy too. Remember, never ever ever do it after you register. Listen to me. It’s too expensive and will slow down your website.
The proper way is to do it when the plugin is activated. In this episode, let’s add our taxonomy registration function to the plugin’s activation handler. Then we’ll deactivate and test. Let me show what it does.
Next, let’s add the handler for when a plugin is uninstalled.
Once upon a time, there was a developer... You! This is going to be a good story...
Total Lab Runtime: 01:30:53
- 1 Lab Introductionfree 08:15
- 2 Custom Taxonomy - The What, Why, and Whenfree 08:32
- 3 Registering a Custom Taxonomypro 09:54
- 4 Configure the Labelspro 14:51
- 5 Bind to Post Typespro 11:55
- 6 Configuring Argumentspro 07:52
- 7 Render Entry Footer Termspro 08:40
- 8 PHP 101: Concatenating Assignment Operatorpro 02:26
- 9 PHP 101: Building Stringspro 08:19
- 10 Test Entry Footer Termspro 03:03
- 11 Flush Rewrite Rulespro 03:56
- 12 Wrap it Uppro 03:10