Skip to main content
clarified the question
Source Link
Abe Caymo
  • 223
  • 2
  • 7

Why isdoes wp_die() not workingwork when inside a namespace?

Consider the following code copied from ACF docs, refactored to work inside a namespace:

add_filter('acf/location/rule_match/user', __NAMESPACE__ . '\acf_location_rule_match_user', 10, 4);
function acf_location_rule_match_user($match, $rule, $options, $field_group)
{

    var_dump($options);
    wp_die();

}

The problem is, nothing happens. What I confirmed this only occurs when I'm inside a namespace. What am I doing wrong?

Why is wp_die() not working?

Consider the following code copied from ACF docs:

add_filter('acf/location/rule_match/user', __NAMESPACE__ . '\acf_location_rule_match_user', 10, 4);
function acf_location_rule_match_user($match, $rule, $options, $field_group)
{

    var_dump($options);
    wp_die();

}

The problem is, nothing happens. What am I doing wrong?

Why does wp_die() not work when inside a namespace?

Consider the following code copied from ACF docs, refactored to work inside a namespace:

add_filter('acf/location/rule_match/user', __NAMESPACE__ . '\acf_location_rule_match_user', 10, 4);
function acf_location_rule_match_user($match, $rule, $options, $field_group)
{

    var_dump($options);
    wp_die();

}

The problem is, nothing happens. I confirmed this only occurs when I'm inside a namespace. What am I doing wrong?

Source Link
Abe Caymo
  • 223
  • 2
  • 7

Why is wp_die() not working?

Consider the following code copied from ACF docs:

add_filter('acf/location/rule_match/user', __NAMESPACE__ . '\acf_location_rule_match_user', 10, 4);
function acf_location_rule_match_user($match, $rule, $options, $field_group)
{

    var_dump($options);
    wp_die();

}

The problem is, nothing happens. What am I doing wrong?