Skip to content

Instantly share code, notes, and snippets.

@imran-khan1
Last active July 10, 2019 06:25
Show Gist options
  • Save imran-khan1/804210cba9bb7fd53bd3fd316db59c18 to your computer and use it in GitHub Desktop.
Save imran-khan1/804210cba9bb7fd53bd3fd316db59c18 to your computer and use it in GitHub Desktop.
<?php
/*
custom filter hook
*/
function custom_filter_something_cool() {
$output = 'Hello World';
return apply_filters('my_custom_filter', $output);
}
echo custom_filter_something_cool();
//Place in functions.php or else
function custom_filter_function( $text ) {
return 'The updated text will appear.';
}
add_filter('my_custom_filter', 'custom_filter_function');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment