__return_true()
Returns true.
Description Description
Useful for returning true to filters easily.
See also See also
Return Return
(true) True.
More Information More Information
Usage:
<?php // This will add a filter on `example_filter` that returns true add_filter( 'example_filter', '__return_true' ); ?>
Source Source
File: wp-includes/functions.php
function __return_true() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return true; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |