bool_from_yn( string $yn ): bool

Determines whether input is yes or no.


Description

Must be ‘y’ to be true.


Top ↑

Parameters

$yn string Required
Character string containing either 'y' (yes) or 'n' (no).

Top ↑

Return

bool True if 'y', false on anything else.


Top ↑

Source

File: wp-includes/functions.php. View all references

function bool_from_yn( $yn ) {
	return ( 'y' === strtolower( $yn ) );
}

Top ↑

Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.