/** * Inits custom types and taxonomies. */ function wpcf_init_custom_types_taxonomies() { $custom_taxonomies = get_option(WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array()); if (!empty($custom_taxonomies)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-taxonomies.php'; wpcf_custom_taxonomies_init(); } $custom_types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array()); if (!empty($custom_types)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-types.php'; wpcf_custom_types_init(); } }
/** * Inits custom types and taxonomies. */ function wpcf_init_custom_types_taxonomies() { $custom_taxonomies = get_option('wpcf-custom-taxonomies', array()); if (!empty($custom_taxonomies)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-taxonomies.php'; wpcf_custom_taxonomies_init(); } $custom_types = get_option('wpcf-custom-types', array()); if (!empty($custom_types)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-types.php'; wpcf_custom_types_init(); } }
/** * Inits custom types and taxonomies. */ function wpcf_init_custom_types_taxonomies() { // register taxonomies first // because custom taxonomies might have rewrite rules that used to have priority over post type rewrite rules, and we keep backwards compatibility // for example, a taxonomy "topic" with rewrite "video/topic" assigned to a "video" post type // - if "video" is registered first, top-level topic archives will render as 404 // - if "topic" is registered first, top-level "topic" terms will have archive pages and "video" posts will have single pages // note that custom taxonomies on register_taxonomy do not check whether the post types they register to do exist or not $custom_taxonomies = get_option(WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array()); if (!empty($custom_taxonomies)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-taxonomies.php'; wpcf_custom_taxonomies_init(); } // register post types $custom_types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array()); if (!empty($custom_types)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-types.php'; wpcf_custom_types_init(); } // and then manage builtin taxonomies registration for post types // because we use register_taxonomy_for_object_type(), which checks if the post type is available if (!empty($custom_taxonomies)) { wpcf_builtin_taxonomies_init(); } }
/** * Inits custom types and taxonomies. */ function wpcf_init_custom_types_taxonomies() { // register post types first $custom_types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array()); if (!empty($custom_types)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-types.php'; wpcf_custom_types_init(); } // and than taxonomies, because register_taxonomy_for_object_type() checks if post type is available $custom_taxonomies = get_option(WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array()); if (!empty($custom_taxonomies)) { require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-taxonomies.php'; wpcf_custom_taxonomies_init(); } }