acf/delete_field

The Advanced Custom Fields acf delete field hook.

Description

do_action( 'acf/delete_field', (unknown) $post_id, (unknown) $key ); 

Parameters (2)

0. $post_id (unknown)
The post id.
1. $key (unknown)
The key.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'acf/delete_field', $post_id, $key ); 
The following example is for adding a hook callback.
  1. // define the acf/delete_field callback 
  2. function action_acf_delete_field( $post_id, $key ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'acf/delete_field', 'action_acf_delete_field', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'acf/delete_field', 'action_acf_delete_field', 10, 2 ); 

Defined (1)

The action is defined in the following location(s).

/core/controllers/field_group.php  
  1. do_action('acf/delete_field', $post_id, $key);