In this episode, you will learn about why, when, what, and how of flushing the rewrite rules for your new custom post type. You’ll learn about permalinks, Rewrite API, and how the page request is mapped through the rewrite rules to figure out what record to pull from the Posts database table. The starter plugin you got at the start of this lab has the rewrite the right way. It’s attached to the plugin activation event. That is the right way to do it. Why? Rebuilding (flushing) rewrites is an expensive process. It takes a lot of time to do […]
In this episode, you will learn about how the web address is converted into a query for WordPress to know what data to pull from the database and what files to call. Let’s talk about how rewrite patterns are stored in the database. WordPress will compare the web address to these stored patterns in order to determine what request it is.