Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript.

Filter:

debugpress-debugger-is-allowed

Control if the current user/visitor can view and use the debugger popup. This filter return value is previously calculated value based on the plugin settings.

This filter has 1 argument.

Arguments

  • $allowed: return TRUE or FALSE. Default: depends on the plugin settings

Example

Allow access only to users with specified user ID’s – 1, 6, 22.

add_filter('debugpress-debugger-is-allowed', 'custom__debugpress-debugger-is-allowed');
function custom__debugpress-debugger-is-allowed($allowed) {
  $user_id = get_current_user_id();

  $allowed = in_array($user_id, array(1, 6, 22);

  return $allowed;
}

 

0
0
615
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply