• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / checked() – Outputs the html checked attribute.

You appear to be a bot. Output may be restricted

Description

Outputs the HTML checked attribute.

Compares the first two arguments and if identical marks as checked

Usage

$string = checked( $checked, $current, $echo );

Parameters

$checked
( mixed ) required – One of the values to compare
$current
( mixed ) optional default: 1 – (true) The other value to compare if not just true
$echo
( bool ) optional default: 1 – Whether to echo or just return the string

Returns

string HTML attribute or empty string

Source

File name: wordpress/wp-includes/general-template.php
Lines:

1 to 3 of 3
function checked( $checked, $current = true, $echo = true ) {
  return __checked_selected_helper( $checked, $current, $echo, 'checked' );
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: checked
Plugin ref: WordPress
Version: 5.6.2
Sourcefile: wp-includes/general-template.php
File ref: wp-includes/general-template.php
Deprecated?: No
API Letters: C

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites