Last active
May 17, 2022 12:26
-
-
Save yanknudtskov/b304f3d833ac999960fbab532ca915d1 to your computer and use it in GitHub Desktop.
Adding support for Advanced Layout Builder on custom post types in Enfold Remeber to add the custom-post type to the arrays #enfold #alb #custom-post-types #cpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enable Layout Builder for Custom Post Types | |
*/ | |
add_theme_support('add_avia_builder_post_type_option'); | |
add_theme_support('avia_template_builder_custom_post_type_grid'); | |
add_filter('avf_builder_boxes','yanco_enable_cpt_layout_builder'); | |
function yanco_enable_cpt_layout_builder( $boxes ) { | |
$boxex = array(); | |
$boxes[] = array( 'title' =>__('Avia Layout Builder','avia_framework' ), 'id'=>'avia_builder', 'page'=>array('post','portfolio','page','product', 'enfold_repeatable', 'CUSTOM_POST_TYPE_HERE'), 'context'=>'normal', 'priority'=>'high', 'expandable'=>true ); | |
$boxes[] = array( 'title' =>__( 'Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('post','portfolio','page','product', 'enfold_repeatable', 'CUSTOM_POST_TYPE_HERE' ), 'context'=>'side', 'priority'=>'low'); | |
$boxes[] = array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('portfolio'), 'context'=>'normal', 'priority'=>'high' ); | |
$boxes[] = array( 'title' =>__('Breadcrumb Hierarchy','avia_framework' ), 'id'=>'hierarchy', 'page'=>array('portfolio'), 'context'=>'side', 'priority'=>'low'); | |
return $boxes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment