WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/bool from yn

Contents

Description

Whether input is yes or no. Must be 'y' to be true.

Usage

<?php bool_from_yn$yn ?>

Parameters

$yn
(string) (required) Character string containing either 'y' or 'n'
Default: None

Return Values

(boolean) 
True if yes, false on anything else

Examples

Notes

  • 'y' returns true,
  • 'Y' returns true,
  • Everything else returns false.

Change Log

Since: 1.0.0

Source File

bool_from_yn() is located in wp-includes/functions.php.

Related

See also index of Function Reference and index of Template Tags.