bool_from_yn( string $yn )

Whether input is yes or no.


Description Description

Must be ‘y’ to be true.


Parameters Parameters

$yn

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


Top ↑

Return Return

(bool) True if yes, false on anything else.


Top ↑

Source Source

File: wp-includes/functions.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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