Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fix Database Cleanup is not working at all
<?php
/**
* Plugin Name: [Hummingbird Pro] - Fix Database Cleanup is not working at all
* Description: [Hummingbird Pro] - Fix Database Cleanup is not working at all - 1144588839545212
* Author: Thobk @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'plugins_loaded', 'wpmudev_hmbp_fix_database_cleanup_not_working_func', 100 );
function wpmudev_hmbp_fix_database_cleanup_not_working_func() {
if( ! is_admin() ){
return;
}
if( defined('WPHB_VERSION') && class_exists( 'Hummingbird\WP_Hummingbird' ) ){
add_action( 'admin_enqueue_scripts', 'wpmudev_hmbp_fix_database_cleanup_not_working_assets', 99 );
function wpmudev_hmbp_fix_database_cleanup_not_working_assets( $hook_suffix ){
if( 'hummingbird-pro_page_wphb-advanced' !== $hook_suffix ){
return;
}
$custom_script = '
(function($){
$(function(){
$("#wphb-db-row-delete").off("click");
$("#wphb-box-advanced-db").on("click", "button", function(e){
e.preventDefault();
var _this = $(this);
WPHB_Admin.advanced.showModal( _this.data("entries"), _this.data("type") );
});
});
})(window.jQuery)
';
wp_add_inline_script( 'wphb-admin', $custom_script );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.