/** * Register Builder portabilities. * * @since To define * * @return bool Always return true. */ function et_pb_register_builder_portabilities() { global $shortname; // Don't overwrite global. $_shortname = empty($shortname) ? 'divi' : $shortname; // Make sure the Portability is loaded. et_core_load_component('portability'); // Register the Roles Editor portability. et_core_portability_register('et_pb_roles', array('name' => esc_html__('Divi Role Editor Settings', 'et_builder'), 'type' => 'options', 'target' => 'et_pb_role_settings', 'view' => isset($_GET['page']) && $_GET['page'] === "et_{$_shortname}_role_editor")); // Register the Builder individual layouts portability. et_core_portability_register('et_builder', array('name' => esc_html__('Divi Builder Layout', 'et_builder'), 'type' => 'post', 'view' => function_exists('et_builder_should_load_framework') && et_builder_should_load_framework())); // Register the Builder Layouts Post Type portability. et_core_portability_register('et_builder_layouts', array('name' => esc_html__('Divi Builder Layouts', 'et_builder'), 'type' => 'post_type', 'target' => ET_BUILDER_LAYOUT_POST_TYPE, 'view' => isset($_GET['post_type']) && $_GET['post_type'] === ET_BUILDER_LAYOUT_POST_TYPE)); }
function et_builder_load_framework() { require ET_BUILDER_DIR . 'functions.php'; // load builder files on front-end and on specific admin pages only. if (et_builder_should_load_framework()) { require ET_BUILDER_DIR . 'layouts.php'; require ET_BUILDER_DIR . 'class-et-builder-element.php'; require ET_BUILDER_DIR . 'class-et-global-settings.php'; do_action('et_builder_framework_loaded'); $action_hook = is_admin() ? 'wp_loaded' : 'wp'; add_action($action_hook, 'et_builder_init_global_settings'); add_action($action_hook, 'et_builder_add_main_elements'); } }
function et_builder_load_framework() { require ET_BUILDER_DIR . 'functions.php'; if (is_admin()) { global $pagenow, $et_current_memory_limit; if (!empty($pagenow) && in_array($pagenow, array('post.php', 'post-new.php'))) { $et_current_memory_limit = intval(@ini_get('memory_limit')); } } // load builder files on front-end and on specific admin pages only. if (et_builder_should_load_framework()) { require ET_BUILDER_DIR . 'layouts.php'; require ET_BUILDER_DIR . 'class-et-builder-element.php'; require ET_BUILDER_DIR . 'class-et-global-settings.php'; require ET_BUILDER_DIR . 'ab-testing.php'; do_action('et_builder_framework_loaded'); $action_hook = is_admin() ? 'wp_loaded' : 'wp'; add_action($action_hook, 'et_builder_init_global_settings'); add_action($action_hook, 'et_builder_add_main_elements'); } }