Last active
August 30, 2019 04:40
-
-
Save wpmudev-sls/d22984a05c644e7b7d3b5cc99910b7d1 to your computer and use it in GitHub Desktop.
[Hummingbird Pro] - Fix Missing Action in Ajax Cloudflare Connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: [Hummingbird Pro] - Fix Missing Action in Ajax Cloudflare Connect | |
* Description: [Hummingbird Pro] - Fix Missing Action in Ajax Cloudflare Connect | |
* Author: Thobk @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/profile/tho2757 | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
add_action( 'plugins_loaded', 'wpmudev_hmbp_fix_missing_action_in_cloudflare_connect_func', 100 ); | |
function wpmudev_hmbp_fix_missing_action_in_cloudflare_connect_func() { | |
if( defined('WPHB_VERSION') ){ | |
add_action( 'init', 'wpmudev_hummingbird_fix_missing_action_cloudflare_connect' ); | |
function wpmudev_hummingbird_fix_missing_action_cloudflare_connect(){ | |
if( isset( $_POST['step'], $_POST['formData'] ) && ! isset( $_POST['action'] ) && 'zone' === $_POST['step'] && strpos($_POST['formData'], 'cloudflare-zone=') === 0 ){ | |
$_REQUEST['action'] = "wphb_cloudflare_connect"; | |
$_REQUEST['nonce'] = wp_create_nonce( 'wphb-fetch' ); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment