They should be registered on the init
-hook ideally (according to the documentation: Registering custom post types.
However, I'm trying to use this boilerplate here: WordPress Plugin Boilerplate, since it seems to have a good thought and layout.
But I'm not sure where in that plugin, to add the registering of new post types?
There is a function: load_dependencies here - but is a custom post type a dependency? Hmm...
Update
I can see that if I do this:
$this->loader->add_action( 'init', $this, 'temp' );
and add that here: includes/class-plugin-name.php -> load_dependencies
And add a function on line 128 like this:
public function temp(){
echo '<pre>';
print_r('Yo!');
echo '</pre>';
}
Then it works.
However... I still don't see the proper place to add this code, in order to follow the plugin standards.