AdvancedCustomFields/acf5-beta — pull request #292 by aaemnnosttv (2014-06-17 03:32:42+00:00)
Title: add acf_form hooks

This PR adds a few hooks to `acf_form_head()` to make the `acf_form` flow more extensible.

The first `acf/acf_form/validate_post` allows the validation to be checked against more than just whether or not the form array is empty or not. Perhaps a halt of execution here would be desired based on other conditions.

The next is `acf/acf_form/post`, which announces the post after it has passed validation (nonce and the previous filter). This can be particularly useful in the case of using the form for something else, like user registration.

Next, `acf/acf_form/return` to make the redirect url filterable. The biggest use case for this I see is perhaps the main reason for this PR - which would be the ability to add the newly created post ID to the redirect url query string.
ex:
```php
function acf_form_return_filter( $url, $form ) {
return add_query_arg('new_id', $form[post_id], $url);
}
add_filter('acf/acf_form/return', 'acf_form_return_filter', 10, 2);
```
The filter fires as part of an evaluation that determines whether the redirect should occur at all, which is another feature.

Lastly, `acf/create_post` for announcing that acf has created a post for us.