The documentation_ignore_functions WordPress PHP filter lets you modify the list of functions and classes to be ignored from the documentation lookup.
Usage
add_filter('documentation_ignore_functions', 'my_custom_ignore_functions'); function my_custom_ignore_functions($ignore_functions) { // your custom code here return $ignore_functions; }
Parameters
$ignore_functions
(string[]): Array of names of functions and classes to be ignored.
More information
See WordPress Developer Resources: documentation_ignore_functions
Examples
Exclude custom functions
Exclude custom functions from the documentation lookup.
add_filter('documentation_ignore_functions', 'exclude_custom_functions'); function exclude_custom_functions($ignore_functions) { $ignore_functions[] = 'my_custom_function'; $ignore_functions[] = 'another_custom_function'; return $ignore_functions; }
Exclude a specific class
Exclude a specific class from the documentation lookup.
add_filter('documentation_ignore_functions', 'exclude_specific_class'); function exclude_specific_class($ignore_functions) { $ignore_functions[] = 'My_Custom_Class'; return $ignore_functions; }
Remove a function from the ignore list
Remove a function from the list of ignored functions.
add_filter('documentation_ignore_functions', 'remove_function_from_ignore_list'); function remove_function_from_ignore_list($ignore_functions) { $key = array_search('function_to_remove', $ignore_functions); if (false !== $key) { unset($ignore_functions[$key]); } return $ignore_functions; }
Clear the ignore list
Clear the entire list of ignored functions and classes.
add_filter('documentation_ignore_functions', 'clear_ignore_list'); function clear_ignore_list($ignore_functions) { return []; }
Add multiple classes to the ignore list
Add multiple classes to the list of ignored classes.
add_filter('documentation_ignore_functions', 'add_multiple_classes_to_ignore_list'); function add_multiple_classes_to_ignore_list($ignore_functions) { $classes_to_ignore = ['Custom_Class_One', 'Custom_Class_Two']; $ignore_functions = array_merge($ignore_functions, $classes_to_ignore); return $ignore_functions; }