_acf_do_save_post()
_acf_do_save_post
Private function hooked into 'acf/save_post' to actually save the $_POST data. This allows developers to hook in before and after ACF has actually saved the data.
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Returns
null. Nothing (null).
Usage
_acf_do_save_post( $post_id );
- $post_id(int|string)
- The post id.
Changelog
| Since 5.7.10 | Introduced. |
_acf_do_save_post() acf do save post code ACF 6.8.8
function _acf_do_save_post( $post_id = 0 ) {
// phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
if ( ! empty( $_POST['acf'] ) ) {
acf_update_values( $_POST['acf'], $post_id ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by WP when saved.
}
// phpcs:enable WordPress.Security.NonceVerification.Missing
}