Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmudev-sls/d22984a05c644e7b7d3b5cc99910b7d1 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/d22984a05c644e7b7d3b5cc99910b7d1 to your computer and use it in GitHub Desktop.
[Hummingbird Pro] - Fix Missing Action in Ajax Cloudflare Connect
<?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