/** * Load Core components. * * This function loads Core components. Components are only loaded once, even if they are called many times. * Admin components/functions are automatically wrapped in an is_admin() check. * * @since 1.0.0 * * @param string|array $components Name of the Core component(s) to include as and indexed array. * * @return bool Always return true. */ function et_core_load_component($components) { static $loaded = array(); // Load in front end and backend. $common = array(); // Only load admin components if is_admin() is true or is FB opened. $admin = is_admin() || et_fb_enabled() ? array('portability' => ET_CORE_PATH . 'admin/includes/portability.php', 'cache' => array(ET_CORE_PATH . 'admin/includes/cache.php', ET_CORE_PATH . 'admin/includes/class-cache.php')) : array(); // Set dependencies. $dependencies = array('portability' => 'cache'); foreach ((array) $components as $component) { // Stop here if the component is already loaded or doesn't exists. if (in_array($component, $loaded) || !isset($common[$component]) && !isset($admin[$component])) { continue; } // Cache loaded component before calling dependencies. $loaded[] = $component; // Load dependencies. if (array_key_exists($component, $dependencies)) { et_core_load_component($dependencies[$component]); } $_components = array(); if (isset($common[$component])) { $_components = (array) $common[$component]; } if (isset($admin[$component])) { $_components = array_merge((array) $_components, (array) $admin[$component]); } foreach ($_components as $component_path) { require_once $component_path; } /** * Fires when an Core component is loaded. * * The dynamic portion of the hook name, $component, refers to the name of the Core component loaded. * * @since 1.0.0 */ do_action('et_core_loaded_component_' . $component); } }
if (!current_user_can('edit_posts')) { return false; } if (!current_user_can('edit_others_posts') && !current_user_can('edit_post', get_the_ID())) { return false; } if ((!current_user_can('publish_posts') || !current_user_can('edit_published_posts')) && 'publish' === get_post_status()) { return false; } if ((!current_user_can('edit_private_posts') || !current_user_can('read_private_posts')) && 'private' === get_post_status()) { return false; } } return true; } define('ET_FB_ENABLED', et_fb_enabled()); // Stop here if the front end builder isn't enabled. if (!ET_FB_ENABLED) { return; } define('ET_FB_URI', ET_BUILDER_URI . '/frontend-builder/app'); define('ET_FB_ASSETS_URI', ET_FB_URI . '/assets'); require_once ET_BUILDER_DIR . 'frontend-builder/view.php'; require_once ET_BUILDER_DIR . 'frontend-builder/assets.php'; require_once ET_BUILDER_DIR . 'frontend-builder/helpers.php'; require_once ET_BUILDER_DIR . 'frontend-builder/rtl.php'; if ('on' === et_get_option('divi_disable_translations', 'off')) { add_filter('locale_stylesheet_uri', 'et_fb_remove_rtl_stylesheet'); add_filter('language_attributes', 'et_fb_remove_html_rtl_dir'); } et_fb_fix_plugin_conflicts();