BeBuilder not available for custom post types
Hey Support Team,
I would like to enable the BeBuilder for an Custom Post Type and found this old discussion:
BeBuilder is not available for custom post types — Betheme Support Forum
Is the Code from there still good to go? Because its not working on my site.
Maybe ive got not all needes supports: 'supports' => ['title','editor','thumbnail','excerpt']?
Comments
Hi,
How did you create your CPT?
Did you use an external plugin, or did you use custom PHP to add it?
Best regards
Hi Phil, i tried both on a test installation.
Here is the functions.php setting:
add_filter('bebuilder_post_types','regionen');
function regionen($post_types) {
$post_types[] = 'regionen';
return $post_types;
}
With CPT UI Plugin ive got the following setup:
function cptui_register_my_cpts_regionen() {
/**
* Post Type: Regionen.
*/
$labels = [
"name" => esc_html__( "Regionen", "custom-post-type-ui" ),
"singular_name" => esc_html__( "Region", "custom-post-type-ui" ),
"menu_name" => esc_html__( "Regionen", "custom-post-type-ui" ),
"all_items" => esc_html__( "Alle Regionen", "custom-post-type-ui" ),
"add_new" => esc_html__( "Neue Region hinzufügen", "custom-post-type-ui" ),
"add_new_item" => esc_html__( "Neue Region hinzufügen", "custom-post-type-ui" ),
"edit_item" => esc_html__( "Region bearbeiten", "custom-post-type-ui" ),
"new_item" => esc_html__( "Neue Region", "custom-post-type-ui" ),
"view_item" => esc_html__( "Region ansehen", "custom-post-type-ui" ),
"view_items" => esc_html__( "Regionen anzeigen", "custom-post-type-ui" ),
"search_items" => esc_html__( "Region durchsuchen", "custom-post-type-ui" ),
"not_found" => esc_html__( "Keine Region gefunden", "custom-post-type-ui" ),
"not_found_in_trash" => esc_html__( "Keine Regionen im Papierkorb gefunden", "custom-post-type-ui" ),
"parent" => esc_html__( "Übergeordnet Region:", "custom-post-type-ui" ),
"featured_image" => esc_html__( "Beitragsbild für diese Region", "custom-post-type-ui" ),
"set_featured_image" => esc_html__( "Beitragsbild für diese Region festlegen", "custom-post-type-ui" ),
"remove_featured_image" => esc_html__( "Beitragsbild von dieser Region entfernen", "custom-post-type-ui" ),
"use_featured_image" => esc_html__( "Als Beitragsbild für diese Region verwenden", "custom-post-type-ui" ),
"archives" => esc_html__( "Region-Archiv", "custom-post-type-ui" ),
"insert_into_item" => esc_html__( "In Region einfügen", "custom-post-type-ui" ),
"uploaded_to_this_item" => esc_html__( "Zu dieser Region hochladen", "custom-post-type-ui" ),
"filter_items_list" => esc_html__( "Regionen-Liste filtern", "custom-post-type-ui" ),
"items_list_navigation" => esc_html__( "Navigation der Regionen-Liste", "custom-post-type-ui" ),
"items_list" => esc_html__( "Regionen-Liste", "custom-post-type-ui" ),
"attributes" => esc_html__( "Regionen-Eigenschaften", "custom-post-type-ui" ),
"name_admin_bar" => esc_html__( "Region", "custom-post-type-ui" ),
"item_published" => esc_html__( "Region veröffentlicht", "custom-post-type-ui" ),
"item_published_privately" => esc_html__( "Region privat veröffentlicht.", "custom-post-type-ui" ),
"item_reverted_to_draft" => esc_html__( "Region auf Entwurf zurückgesetzt.", "custom-post-type-ui" ),
"item_trashed" => esc_html__( "Region wurde in den Papierkorb verschoben.", "custom-post-type-ui" ),
"item_scheduled" => esc_html__( "Region geplant", "custom-post-type-ui" ),
"item_updated" => esc_html__( "Region aktualisiert.", "custom-post-type-ui" ),
"template_name" => esc_html__( "Einzelnes Element: Region", "custom-post-type-ui" ),
"parent_item_colon" => esc_html__( "Übergeordnet Region:", "custom-post-type-ui" ),
];
$args = [
"label" => esc_html__( "Regionen", "custom-post-type-ui" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"rest_namespace" => "wp/v2",
"has_archive" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"can_export" => false,
"rewrite" => [ "slug" => "regionen", "with_front" => true ],
"query_var" => true,
"menu_icon" => "dashicons-location-alt",
"supports" => [ "title", "editor", "thumbnail", "excerpt", "custom-fields", "author", "page-attributes", "post-formats" ],
"show_in_graphql" => false,
];
register_post_type( "regionen", $args );
}
add_action( 'init', 'cptui_register_my_cpts_regionen' );
Please send us the WordPress dashboard and FTP access privately through the contact form, which is on the right side at https://themeforest.net/user/muffingroup#contact and we will check what might be the reason.
Notice!
Please attach a link to this forum discussion.
Sending incorrect or incomplete data will result in a longer response time.
Therefore, please ensure that the data you send are complete and correct.
Thanks