Exciting News! Flipper Code is now WePlugins! Same commitment to excellence, brand new identity.

How to use documentation_ignore_functions filter in WordPress

Sandeep Kumar Mishra
Sandeep Kumar Mishra
March 17, 2023
5 minutes read

WordPress hooks are like magic wands for developers, especially for us folks who love tinkering around with code. One such hook is the documentation_ignore_functions filter, which helps you filter out certain functions and classes from the documentation lookup. It’s a handy tool, and I’m excited to share how you can make the most of it.

Example 1: Basic Usage of documentation_ignore_functions

Here’s a simple example to get you started. This snippet modifies the default list of functions to be ignored.

    function weplugins_modify_documentation_ignore_functions_defaults($ignore_functions) { 
        // Update the $ignore_functions variable according to your website requirements and return this variable.
        return $ignore_functions; 
    }
    add_filter("documentation_ignore_functions", "weplugins_modify_documentation_ignore_functions_defaults", 10, 1);
    

Example 2: Conditional Modification

Sometimes, you might want to modify the ignored functions list based on certain conditions. Here’s how you can do that.

    function weplugins_conditional_ignore_functions($ignore_functions) {
        if (is_admin()) {
            // Modify the $ignore_functions array specifically for admin pages.
        }
        return $ignore_functions;
    }
    add_filter("documentation_ignore_functions", "weplugins_conditional_ignore_functions", 10, 1);
    

Example 3: Removing the Hook

If you need to remove a previously registered hook, here’s how you can achieve it.

    remove_filter("documentation_ignore_functions", "weplugins_modify_documentation_ignore_functions_defaults", 10, 1);
    

Access Premium WordPress Plugins

Need a hand with customization? Feel free to Contact Us. We’re here to help!

Sandeep Kumar Mishra

Sandeep Kumar Mishra

Sandeep Kumar Mishra writes about WordPress and Artificial Intelligence, offering tips and guides to help you master your website and stay updated with the latest tech trends.

Explore the latest in WordPress

Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.