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/e91d5f03fc26053ac4b06c36fb5fdd95 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/e91d5f03fc26053ac4b06c36fb5fdd95 to your computer and use it in GitHub Desktop.
[MarketPress] - Fix Cache Issue on WPMUDEV Metabox
<?php
/**
* Plugin Name: [MarketPress] - Fix Cache Issue on WPMUDEV Metabox
* Description: [MarketPress] - Fix cache issue on WPMUDEV Metabox, the action save metabox fields not trigger - 1120836882951224
* Plugin URI: https://premium.wpmudev.org/
* Author: WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'plugins_loaded', 'wpmudev_mp_fix_cache_metabox_issue_load_func', 100 );
function wpmudev_mp_fix_cache_metabox_issue_load_func() {
if ( defined( 'MP_VERSION' ) && class_exists( 'Marketpress' ) ) {
// clear cache admin
add_action( 'wpmudev_metabox/before_save_fields/mp-product-type-metabox', 'wpmudev_mp_clear_save_fields_metabox_cache' );
function wpmudev_mp_clear_save_fields_metabox_cache(){
wp_cache_delete( 'save_fields', 'wpmudev_metaboxes' );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment