1. Home
  2. Docs
  3. Greenlet Hooks
  4. Filters

Filters

Greenlet comes with various WordPress filter hooks. These hooks allow you to modify specific data used in the theme.

Example of a Greenlet filter hook:
To change the text on the search result page when no posts are found, you can use the following code in your child theme or custom plugin:

function get_changed_nopost_text() {
	return 'No posts found for that query!';
}

add_filter( 'greenlet_nopost_text', 'get_changed_nopost_text' );

The above code registers get_changed_nopost_text to return modified text when Greenlet executes apply_filters( 'greenlet_nopost_text', 'Nothing found' ) which is located at /content-none.php
Learn more about WordPress filters

Articles