====== ACF - Advanced Custom Fields ====== [[https://wordpress.org/plugins/advanced-custom-fields/|Advanced Custom Fields]] * [[https://capitainewp.io/formations/acf/hooker-champs-acf/|Hooker les champs ACF pour modifier leurs valeurs]] * [[https://mosaika.fr/astuces-developpement-acf/|8 snippets pour modifier le comportement d’ACF]] ===== acf form ===== Documentation * [[https://www.advancedcustomfields.com/resources/using-acf_form-to-create-a-new-post/|Using acf_form to create a new post]] * [[https://www.advancedcustomfields.com/resources/create-a-front-end-form/|Create a front end form]] * [[https://www.advancedcustomfields.com/resources/acf_form/|acf_form()]] ==== Event 'acf/save_post' ==== ''do_action( 'acf/save_post', $post_id );'' Différence entre "admin" et "front" : * en back ''is_admin() == true'' le ''$post_id'' et le ''global $post'' concerne le même post ; * en front ''is_admin() == false'' le ''$post_id'' est celui du nouveau post alors que le ''global $post'' est la page utilisée pour le formulaire.