Is register_post_type function only called in admin?
I have several custom post types, each in a separate file like cpt-books.php, cpt-movies.php etc. Besides just register_post_type I have code to add metaboxes etc. for each post type.
Then in functions.php I'm requiring these files like so:
require_once('cpt-books.php');
require_once('cpt-movies.php');
...
Can I do it this way? So these files are only loaded in the admin and not on the front end?
if(is_admin()) {
require_once('cpt-books.php');
require_once('cpt-movies.php');
...
}
Is it going to work properly? Or