/
op-enigma-pro-fix.php
42 lines (37 loc) · 1.47 KB
/
op-enigma-pro-fix.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* Dashboard. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://www.optimizepress.com/
* @since 1.0.0
* @package Op_EnigmePro_Fix
*
* @wordpress-plugin
* Plugin Name: OptimizePress EnigmaPro theme fix
* Plugin URI: http://www.optimizepress.com/
* Description: Removes weblizar_scripts and weblizar_footer_js actions from LiveEditor pages
* Version: 1.0.0
* Author: OptimizePress
* Author URI: http://www.optimizepress.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: op-enigmapro-fix
* Domain Path: /languages
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
function op_remove_enigmapro_js() {
$checkIfLEPage = get_post_meta( url_to_postid( "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] ), '_optimizepress_pagebuilder', true );
if ($checkIfLEPage || $_GET['page'] == 'optimizepress-page-builder' || defined('OP_LIVEEDITOR')){
remove_action('wp_enqueue_scripts', 'weblizar_scripts',10);
remove_action('wp_footer', 'weblizar_footer_js', 10);
}
}
add_action('init', 'op_remove_enigmapro_js');