Last active
December 11, 2016 14:25
-
-
Save jonathanbardo/3990cbea53664701af82c94041c10abc to your computer and use it in GitHub Desktop.
If WordPress required PHP >= 5.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists( '__return' ) ) { | |
function __return( $return ) { | |
return function() use ( $return ) { | |
return $return; | |
}; | |
}; | |
} | |
add_filter( 'YOUR_FILTER', __return( 'YOURSTRING' ) ); | |
// The above is so much cleaner than doing | |
add_filter( 'YOUR_FILTER', function() { return 'YOURSTRING'; } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
❤️