Last active
May 16, 2019 11:34
-
-
Save wpmudev-sls/e91d5f03fc26053ac4b06c36fb5fdd95 to your computer and use it in GitHub Desktop.
[MarketPress] - Fix Cache Issue on WPMUDEV Metabox
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: [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