Home / APIs / __checked_selected_helper() – Private helper function for checked, selected, and disabled.

Description

Private helper function for checked, selected, disabled and readonly.

Compares the first two arguments and if identical marks as $type

Usage

$string = __checked_selected_helper( $helper, $current, $echo, $type );

Parameters

$helper
( mixed ) required – One of the values to compare
$current
( mixed ) required – (true) The other value to compare if not just true
$echo
( bool ) required – Whether to echo or just return the string
$type
( string ) required – The type of checked|selected|disabled|readonly we are doing

Returns

string html attribute or empty string

Source

File name: wordpress/wp-includes/general-template.php
Lines: 1 to 11 of 11

function __checked_selected_helper( $helper, $current, $echo, $type ) {
  if ( (string) $helper === (string) $current )
    $result = " $type='$type'";
  else
    $result = '';

  if ( $echo )
    echo $result;

  return $result;
}
 

 View on GitHub View on Trac

Called by

1 to 4 of 4

  • checked() – Outputs the html checked attribute.
  • disabled() – Outputs the html disabled attribute.
  • readonly() – Outputs the html readonly attribute.
  • selected() – Outputs the html selected attribute.

Invoked by

    Calls

    1 to 1 of 1

    • __checked_selected_helper() – Private helper function for checked, selected, and disabled.

    Call hooks

    Function name: __checked_selected_helper
    Plugin ref: WordPress
    Version: 4.9
    Sourcefile: wp-includes/general-template.php
    File ref: wp-includes/general-template.php
    API type: private
    Deprecated?: No
    API Letters: _,C,H,S

    Published: 10th March 2017 | Last updated: 10th March 2017

    Information

    Function name: __checked_selected_helper
    Plugin ref: WordPress
    Version: 4.9
    Sourcefile: wp-includes/general-template.php
    File ref: wp-includes/general-template.php
    API type: private
    Deprecated?: No
    API Letters: _,C,H,S

    • Plugins
    • Themes
    • Shortcodes
    • APIs
    • Files
    • Hooks
    • Classes
    • Home
    • Sites
    • Sitemap
    • Blog
    oik-plugins WordPress a2z
    WordPress Dynamic API Reference

    Site:  wp-a2z.org
    © Copyright oik-plugins 2014-2018. All rights reserved.


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