示例#1
0
 function et_maybe_increase_memory_limit()
 {
     global $pagenow;
     if (!is_admin()) {
         return;
     }
     if (defined('DOING_AJAX') && DOING_AJAX) {
         return;
     }
     if (!current_user_can('edit_posts')) {
         return;
     }
     if (empty($pagenow)) {
         return;
     }
     // increase memory limit on Edit Post page only
     if (!in_array($pagenow, array('post.php', 'post-new.php'))) {
         return;
     }
     /**
      * check if a user clicked "Increase Memory Limit" button
      * in the "Failure Notification" modal window
      */
     if (!et_should_memory_limit_increase()) {
         return;
     }
     et_increase_memory_limit();
 }
示例#2
0
<?php

require_once ET_BUILDER_DIR . 'core.php';
if (defined('DOING_AJAX') && DOING_AJAX && !is_customize_preview()) {
    $builder_load_actions = array('et_pb_get_backbone_template', 'et_pb_get_backbone_templates', 'et_pb_execute_content_shortcodes', 'et_pb_ab_builder_data', 'et_pb_create_ab_tables', 'et_pb_update_stats_table', 'et_pb_ab_clear_cache', 'et_pb_ab_clear_stats');
    $force_builder_load = isset($_POST['et_load_builder_modules']) && '1' === $_POST['et_load_builder_modules'];
    if (!$force_builder_load && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], $builder_load_actions))) {
        return;
    }
    if (et_should_memory_limit_increase()) {
        et_increase_memory_limit();
    }
}
function et_builder_load_global_functions_script()
{
    wp_enqueue_script('et-builder-modules-global-functions-script', ET_BUILDER_URI . '/scripts/frontend-builder-global-functions.js', array('jquery'), ET_BUILDER_VERSION, true);
}
add_action('wp_enqueue_scripts', 'et_builder_load_global_functions_script', 7);
function et_builder_load_modules_styles()
{
    $current_page_id = apply_filters('et_is_ab_testing_active_post_id', get_the_ID());
    wp_register_script('google-maps-api', esc_url(add_query_arg(array('v' => 3, 'sensor' => 'false'), is_ssl() ? 'https://maps-api-ssl.google.com/maps/api/js' : 'http://maps.google.com/maps/api/js')), array(), ET_BUILDER_VERSION, true);
    wp_enqueue_script('divi-fitvids', ET_BUILDER_URI . '/scripts/jquery.fitvids.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_enqueue_script('waypoints', ET_BUILDER_URI . '/scripts/waypoints.min.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_enqueue_script('magnific-popup', ET_BUILDER_URI . '/scripts/jquery.magnific-popup.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_register_script('hashchange', ET_BUILDER_URI . '/scripts/jquery.hashchange.js', array('jquery'), ET_BUILDER_VERSION, true);
    wp_register_script('salvattore', ET_BUILDER_URI . '/scripts/salvattore.min.js', array(), ET_BUILDER_VERSION, true);
    wp_register_script('easypiechart', ET_BUILDER_URI . '/scripts/jquery.easypiechart.js', array('jquery'), ET_BUILDER_VERSION, true);
    if (et_is_builder_plugin_active()) {
        wp_register_script('fittext', ET_BUILDER_URI . '/scripts/jquery.fittext.js', array('jquery'), ET_BUILDER_VERSION, true);
    }