Closed kevinwhoffman closed 7 years ago
@DevinWalker The reason activation_flush_rewrites()
is not being called is because the activation hook shown below is being registered too late. I confirmed via Xdebug that the activation hook is definitely being registered, but I think it's registered after that hook has already fired. I could use a second opinion. Thanks.
https://github.com/WordImpress/Google-Maps-Builder/blob/master/google-maps-builder.php#L124-L127
Yeah it is being fired too late, please proceed with fixing.
Issue Overview
After installation, single map posts result in 404 errors until permalinks are refreshed. This can be resolved by visiting Settings > Permalinks, but it should be done programmatically on activation.
Possible Solution
This function
activation_flush_rewrites()
is never being called, so the permalinks never get refreshed after the CPT is registered. I believe this broke when core was separated out from the free and pro repos.https://github.com/WordImpress/maps-builder-core/blob/master/includes/class-gmc-activate.php#L526-L532
Steps to Reproduce
Related
https://wordpress.org/support/topic/nothing-found-when-trying-to-view-map/