I would find best practices in performance, clean code and child theme ready, for plugin that add some custom post types to my theme.
What di you think about something like this?
if ( ! function_exists( 'custom_taxonomy_1' ) ) {
function custom_taxonomy_1() {
$args = array(
...
);
register_taxonomy( 'custom_taxonomy_1', array( 'custom_post_type_1' ), $args );
}
}
if ( ! function_exists( 'custom_post_type_1' ) ) {
function custom_post_type_1() {
$args = array(
...
);
register_post_type( 'custom_post_type_1', $args );
}
}
if ( ! function_exists( 'custom_post_type_2' ) ) {
function custom_post_type_2() {
$args = array(
...
);
register_post_type( 'custom_post_type_2', $args );
}
}
if ( ! function_exists('my_init_register_types') ) {
function my_init_register_types(){
custom_taxonomy_1();
custom_post_type_1();
custom_post_type_2();
}
add_action( 'init', 'my_init_register_types' );
}