__return_empty_string() WordPress Function
The __return_empty_string() function is a simple utility function that returns an empty string. This function is useful for returning an empty value from a filter or action callback.
__return_empty_string() #
Returns an empty string.
Description
Useful for returning an empty string to filters easily.
See also
Return
(string) Empty string.
More Information
Usage:
// This will add a filter on `example_filter` that returns an empty string add_filter( 'example_filter', '__return_empty_string' );
Source
File: wp-includes/functions.php
function __return_empty_string() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return ''; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |