• Resolved Howdy_McGee

    (@howdy_mcgee)


    I have a couple “private” custom post types where I want to add Beaver Builder support for. I would guess that because my post type isn’t “Public” – Beaver Builder won’t recognize that it’s an additional option. Can I manually add Beaver Builder to my Private Post Type? Here’s how I have it registered:

    register_post_type( 'cpt_privates', array(
    	'labels' 			=> 	array(
    		'name'			=>		__( 'Private Pages' ),
    		'singular_name'	=>		__( 'Private Page' ),
    		'all_items'		=>		__( 'View Private Pages' ),
    		'add_new'		=>		__( 'New Private Page' ),
    		'add_new_item'	=>		__( 'New Private Page' ),
    		'edit_item'		=>		__( 'Edit Private Page' ),
    		'view_item'		=>		__( 'View Private Page' ),
    		'search_items'	=>		__( 'Search Private Pages' ),
    		'no_found'		=>		__( 'No Private Pages Found' ),
    		'not_found_in_trash' =>	__( 'No Private Pages in Trash' )
    	),
    	'public'			=> 	false, 
    	'publicly_queryable'=> 	true,
    	'exclude_from_search'=>	true,
    	'show_ui' 			=> 	true, 
    	'query_var' 		=> 	false,
    	'show_in_nav_menus'	=>	false,
    	'capability_type' 	=> 	'page',
    	'hierarchical' 		=> 	false,
    	'menu_position' 	=> 	23,
    	'rewrite'			=> 	array( 'slug' => 'private', 'with_front' => 'false' ),
    	'supports' 			=> 	array( 'title', 'editor', 'thumbnail' )
    ) );

    Using the above code – Beaver Builder does not give me the option to check this Post Type in the settings to “Show Beaver Builder” – how can I change this while still keeping my Custom Post Type private?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ben Carlo

    (@hinampaksh)

    Hey there,

    Thanks for posting!

    Can you try adding the filter below to your child theme’s functions.php file and see if it works?

    function my_builder_post_types( $post_types ) {
        $post_types[] = 'my-post-type-slug';
        return $post_types;
    }
    
    add_filter( 'fl_builder_post_types', 'my_builder_post_types' );

    Ben

    Thread Starter Howdy_McGee

    (@howdy_mcgee)

    Thanks Ben!

    For future readers – this does add the Page Builder to the post type itself but will not add it to the Page Builder “Post Types” settings tab. I personally don’t mind that so totes resolved!

    Plugin Contributor Ben Carlo

    (@hinampaksh)

    Awesome! And thanks for taking the time to inform us. 🙂

    Enjoy BB!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Beaver Builder on Private Custom Post Types’ is closed to new replies.