We were instantiating Archiveless twice - this PR removes one instance of that.
Previously, we were setting REST-related filters on after_setup_theme. This is too early for CPTs, which are registered on init. This resulted in WP reporting that a post had been reverted to draft (even though it had not), when toggling archiveless on for a CPT under Gutenberg. This PR delays that REST modification until init has fired, thereby also catching CPTs.
after_setup_theme
. This is too early for CPTs, which are registered on init. This resulted in WP reporting that a post had been reverted to draft (even though it had not), when toggling archiveless on for a CPT under Gutenberg. This PR delays that REST modification until init has fired, thereby also catching CPTs.