Skip to content

Instantly share code, notes, and snippets.

@hostz-frank
Last active November 18, 2016 20:44
Show Gist options
  • Save hostz-frank/a9e95be476508738b7ba to your computer and use it in GitHub Desktop.
Save hostz-frank/a9e95be476508738b7ba to your computer and use it in GitHub Desktop.
Enable the Fusion Core Builder on other WordPress CPT's (custom post types).
<?php
/*
Plugin Name: Fusion Core on Events
Description: Enables the ThemeFusion Core page builder on post type "tribe_events" of The Events Calendar
*/
defined( 'ABSPATH' ) OR die();
/**
* Enable Fusion Pagebuilder for post type "tribe_events" (The Events Calendar).
*/
add_action ( 'plugins_loaded', function () {
remove_action( 'plugins_loaded', array( 'Fusion_Core_PageBuilder', 'get_instance' ) );
if( ! get_option( 'avada_disable_builder' ) ) {
if ( is_admin() ) {
require_once( WP_PLUGIN_DIR . '/fusion-core/admin/class-pagebuilder.php' );
require_once( WP_PLUGIN_DIR . '/fusion-core/admin/page-builder/classes/class-ui.php' );
$instance = Fusion_Core_PageBuilder::get_instance();
$instance->allowed_post_types[] = 'tribe_events';
$ui = Fusion_Core_PageBuilder_UI::get_instance();
$ui->settings['allowed_post_types'][] = 'tribe_events';
}
}
}, 9); // priority 9 to be called before the line of fusion-core.php
@Pixelartist
Copy link

Thanks for this snippet! As you already mentioned - it will be hard for them to integrate it into their core, but they should at least offer an optional setting for people who are not that used to code.

@bonzinho
Copy link

bonzinho commented Oct 6, 2016

Hi, i put this code in functions.php but doest work, can u say me where i need put this code?

Thanks in advance

@AymanEG
Copy link

AymanEG commented Nov 18, 2016

Hello,

Can you update this to last version of Avada ?!

regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment