- noncing the ajax action

Now we leverage the nonce we set in our wp_localize_script function
and pass it to our data var in the JS.

On the server side we use check_ajax_referer. First param is the nonce
we should be checking. 2nd param is where we should be checking for it
in our AJAX values that just came through.

Again minimal code that simply returns a success object up front so we
can tell we wrote sane code.
- now we are saving the todo item

We start by defining $save_me false since we don't want to save by
default.

Then we check to make sure we have a title for our task. No title we
don't want to save our task.

We also check to make sure that the current user can infact actually
create a new task.

If both of those conditions are met we set $save_me true and then go on
with our saving.

We use a Yoda condition to check $save_me (see the WP coding standards
for why) then setup our post args.

wp_insert_post returns a WP_ERROR object if the post save fails so we
make sure that we check for it and give a reasonable message back to the
user.

Right at the end we return the json response to our JS so that we could
actually do something with it.