From 8540a0d1c69aed106aae7265d661da450f6869d3 Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Tue, 22 Dec 2020 06:20:56 +0000 Subject: [PATCH] meta function update --- lib/classes/class-meta-box.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/classes/class-meta-box.php b/lib/classes/class-meta-box.php index 760d1d4..f31decc 100755 --- a/lib/classes/class-meta-box.php +++ b/lib/classes/class-meta-box.php @@ -39,6 +39,23 @@ if ( ! class_exists( 'AddMetaBox' ) ) { public function save_post( $post_id ) { + if (!isset($_POST['mep_event_ricn_text_nonce']) || !wp_verify_nonce($_POST['mep_event_ricn_text_nonce'], 'mep_event_ricn_text_nonce')) { + return; + } + + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { + return; + } + + if (!current_user_can('edit_post', $post_id)) { + return; + } + + + /** + * If the saving post is event then go on + */ + if (get_post_type($post_id) == 'mep_events') { $get_option_name = $this->get_option_name(); $post_id = $this->get_post_id(); @@ -70,7 +87,7 @@ if ( ! class_exists( 'AddMetaBox' ) ) { endforeach; endif; - + } }