__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.

Top ↑

See also


Top ↑

Return

(string) Empty string.


Top ↑

More Information

Usage:
// This will add a filter on `example_filter` that returns an empty string
add_filter( 'example_filter', '__return_empty_string' ); 

Top ↑

Source

File: wp-includes/functions.php

function __return_empty_string() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
	return '';
}

Top ↑

Changelog

Changelog
VersionDescription
3.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More