function gdlr_lms_save_certificate_meta_box($post_id) { // verify nonce & user's permission if (!isset($_POST['certificate_meta_box_nonce'])) { return; } if (!wp_verify_nonce($_POST['certificate_meta_box_nonce'], 'certificate_meta_box')) { return; } if (!current_user_can('edit_post', $post_id)) { return; } // save value if (isset($_POST['gdlr-lms-certificate-settings'])) { update_post_meta($post_id, 'gdlr-lms-certificate-settings', gdlr_lms_preventslashes($_POST['gdlr-lms-certificate-settings'])); } }
function gdlr_soccer_save_fixture_result_meta_box($post_id) { // verify nonce & user's permission if (!isset($_POST['fixture_result_meta_box_nonce'])) { return; } if (!wp_verify_nonce($_POST['fixture_result_meta_box_nonce'], 'fixture_result_meta_box')) { return; } if (!current_user_can('edit_post', $post_id)) { return; } // save value if (isset($_POST['gdlr-soccer-fixture-result-settings'])) { $far_val = $_POST['gdlr-soccer-fixture-result-settings']; $far_options = empty($far_val) ? array() : json_decode(stripslashes($far_val), true); update_post_meta($post_id, 'gdlr-soccer-fixture-result-settings', gdlr_lms_preventslashes($far_val)); update_post_meta($post_id, 'gdlr-start-date', $far_options['date-of-match'] . ' ' . $far_options['match-time']); } }