WordPress at a glance

checked() WP 1.0

Outputs the html checked attribute.

Compares the first two arguments and if identical marks as checked

No Hooks.

Return

String. html attribute or empty string

Usage

checked( $checked, $current, $echo );
$checked(mixed) (required)
One of the values to compare
$current(mixed)
(true) The other value to compare if not just true
Default: true
$echo(true/false)
Whether to echo or just return the string
Default: true

Code of checked: wp-includes/general-template.php VER 5.0.1

<?php
function checked( $checked, $current = true, $echo = true ) {
	return __checked_selected_helper( $checked, $current, $echo, 'checked' );
}

Related Functions

From tag: form functions

More from tag: Supporting (helper utility auxiliary)

No comments
    Hello, !     Log In . Register