function test_pmp_subscribe_to_update_save() { $post = get_post($this->not_subscribed); $_POST['pmp_mega_meta_box_nonce'] = wp_create_nonce('pmp_mega_meta_box'); $_POST['pmp_subscribe_to_updates'] = 'on'; pmp_subscribe_to_update_save($post->ID); $meta = get_post_meta($post->ID, 'pmp_subscribe_to_updates', true); $this->assertEquals('on', $meta); }
/** * Save function for the PMP mega meta box * * @since 0.3 */ function pmp_mega_meta_box_save($post_id) { if (!isset($_POST['pmp_mega_meta_box_nonce'])) { return; } if (!wp_verify_nonce($_POST['pmp_mega_meta_box_nonce'], 'pmp_mega_meta_box')) { return; } if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } if (!current_user_can('edit_post', $post_id)) { return; } pmp_subscribe_to_update_save($post_id); pmp_save_override_defaults($post_id); }