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; - + } }