2. Hummingbird API Docs
2.1 Action: wphb_delete_db_data
Copy chapter anchor to clipboardDescription
Can be used to run certain actions or configure notifications for database cleanup actions. Will fire after the database cleanup task in Advanced Tools – Database Cleanup.
Usage
add_action( ‘wphb_delete_db_data’, ‘database_cleanup’, 10, 2 );
Parameters
Example
2.2 Action: wphb_get_performance_report
Copy chapter anchor to clipboardDescription
Will fire after Hummingbird fetches the latest Performance report.
Usage
add_action( ‘wphb_get_performance_report’, ‘performance_report’ );
Parameters
Example
2.3 Action: wphb_clear_page_cache
Copy chapter anchor to clipboardDescription
Allows to clear the page cache.
Usage
do_action( ‘wphb_clear_page_cache’, $page_id );
Parameters
Example
2.4 Filter: wp_hummingbird_is_active_module_minify', '__return_false
Copy chapter anchor to clipboardDescription
Disables minification when Hummingbird is active.
Example
For example, if you want to disable minification for a post page with an ID=24, you can add the following to the functions.php file:
2.5 Filter: wphb_page_cache_custom_terms
Copy chapter anchor to clipboardDescription
Allows to clear custom terms on page/post update
Example
For example, this filter can be used to clear product categories in WooCommerce, when a product is updated:
2.6 Endpoint: /status/(?P<module>[\\w-]+)
Copy chapter anchor to clipboardDescription
Allows to fetch the status of Gzip compression and Browser caching modules.
Usage
Query
http://example.com/wp-json/hummingbird/v1/status/gzip
Return
Query
http://example.com/wp-json/hummingbird/v1/status/caching
Return
2.7 Endpoint: /clear_cache/(?P<module>[\\w-]+)
Copy chapter anchor to clipboardDescription
Allow to clear the cache for various Hummingbird modules.
Usage
Query
http://example.com/wp-json/hummingbird/v1/clear_cache/
List of module names:
- page_cache
- performance
- gravatar
- minify
- cloudflare