Here is a small function I’ve growed to use when I built a WordPress plugin or site for myself. This could eventually be in core one day if WordPress would raise the minimum requirement of PHP to 5.3.

<?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'; } );

On a sidenote, we could also finally use namespaces…