@@ -4763,14 +4763,16 @@ function get_the_generator( $type = '' ) {
4763
4763
/**
4764
4764
* Outputs the HTML checked attribute.
4765
4765
*
4766
- * Compares the first two arguments and if identical marks as checked
4766
+ * Compares the first two arguments and if identical marks as checked.
4767
4767
*
4768
4768
* @since 1.0.0
4769
4769
*
4770
- * @param mixed $checked One of the values to compare
4771
- * @param mixed $current (true) The other value to compare if not just true
4772
- * @param bool $echo Whether to echo or just return the string
4773
- * @return string HTML attribute or empty string
4770
+ * @param mixed $checked One of the values to compare.
4771
+ * @param mixed $current Optional. The other value to compare if not just true.
4772
+ * Default true.
4773
+ * @param bool $echo Optional. Whether to echo or just return the string.
4774
+ * Default true.
4775
+ * @return string HTML attribute or empty string.
4774
4776
*/
4775
4777
function checked ( $ checked , $ current = true , $ echo = true ) {
4776
4778
return __checked_selected_helper ( $ checked , $ current , $ echo , 'checked ' );
@@ -4779,14 +4781,16 @@ function checked( $checked, $current = true, $echo = true ) {
4779
4781
/**
4780
4782
* Outputs the HTML selected attribute.
4781
4783
*
4782
- * Compares the first two arguments and if identical marks as selected
4784
+ * Compares the first two arguments and if identical marks as selected.
4783
4785
*
4784
4786
* @since 1.0.0
4785
4787
*
4786
- * @param mixed $selected One of the values to compare
4787
- * @param mixed $current (true) The other value to compare if not just true
4788
- * @param bool $echo Whether to echo or just return the string
4789
- * @return string HTML attribute or empty string
4788
+ * @param mixed $selected One of the values to compare.
4789
+ * @param mixed $current Optional. The other value to compare if not just true.
4790
+ * Default true.
4791
+ * @param bool $echo Optional. Whether to echo or just return the string.
4792
+ * Default true.
4793
+ * @return string HTML attribute or empty string.
4790
4794
*/
4791
4795
function selected ( $ selected , $ current = true , $ echo = true ) {
4792
4796
return __checked_selected_helper ( $ selected , $ current , $ echo , 'selected ' );
@@ -4795,14 +4799,16 @@ function selected( $selected, $current = true, $echo = true ) {
4795
4799
/**
4796
4800
* Outputs the HTML disabled attribute.
4797
4801
*
4798
- * Compares the first two arguments and if identical marks as disabled
4802
+ * Compares the first two arguments and if identical marks as disabled.
4799
4803
*
4800
4804
* @since 3.0.0
4801
4805
*
4802
- * @param mixed $disabled One of the values to compare
4803
- * @param mixed $current (true) The other value to compare if not just true
4804
- * @param bool $echo Whether to echo or just return the string
4805
- * @return string HTML attribute or empty string
4806
+ * @param mixed $disabled One of the values to compare.
4807
+ * @param mixed $current Optional. The other value to compare if not just true.
4808
+ * Default true.
4809
+ * @param bool $echo Optional. Whether to echo or just return the string.
4810
+ * Default true.
4811
+ * @return string HTML attribute or empty string.
4806
4812
*/
4807
4813
function disabled ( $ disabled , $ current = true , $ echo = true ) {
4808
4814
return __checked_selected_helper ( $ disabled , $ current , $ echo , 'disabled ' );
@@ -4811,14 +4817,16 @@ function disabled( $disabled, $current = true, $echo = true ) {
4811
4817
/**
4812
4818
* Outputs the HTML readonly attribute.
4813
4819
*
4814
- * Compares the first two arguments and if identical marks as readonly
4820
+ * Compares the first two arguments and if identical marks as readonly.
4815
4821
*
4816
4822
* @since 5.9.0
4817
4823
*
4818
- * @param mixed $readonly One of the values to compare
4819
- * @param mixed $current (true) The other value to compare if not just true
4820
- * @param bool $echo Whether to echo or just return the string
4821
- * @return string HTML attribute or empty string
4824
+ * @param mixed $readonly One of the values to compare.
4825
+ * @param mixed $current Optional. The other value to compare if not just true.
4826
+ * Default true.
4827
+ * @param bool $echo Optional. Whether to echo or just return the string.
4828
+ * Default true.
4829
+ * @return string HTML attribute or empty string.
4822
4830
*/
4823
4831
function wp_readonly ( $ readonly , $ current = true , $ echo = true ) {
4824
4832
return __checked_selected_helper ( $ readonly , $ current , $ echo , 'readonly ' );
@@ -4837,16 +4845,16 @@ function wp_readonly( $readonly, $current = true, $echo = true ) {
4837
4845
/**
4838
4846
* Private helper function for checked, selected, disabled and readonly.
4839
4847
*
4840
- * Compares the first two arguments and if identical marks as $type
4848
+ * Compares the first two arguments and if identical marks as ` $type`.
4841
4849
*
4842
4850
* @since 2.8.0
4843
4851
* @access private
4844
4852
*
4845
- * @param mixed $helper One of the values to compare
4846
- * @param mixed $current (true) The other value to compare if not just true
4847
- * @param bool $echo Whether to echo or just return the string
4848
- * @param string $type The type of checked|selected|disabled|readonly we are doing
4849
- * @return string HTML attribute or empty string
4853
+ * @param mixed $helper One of the values to compare.
4854
+ * @param mixed $current The other value to compare if not just true.
4855
+ * @param bool $echo Whether to echo or just return the string.
4856
+ * @param string $type The type of checked|selected|disabled|readonly we are doing.
4857
+ * @return string HTML attribute or empty string.
4850
4858
*/
4851
4859
function __checked_selected_helper ( $ helper , $ current , $ echo , $ type ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore
4852
4860
if ( (string ) $ helper === (string ) $ current ) {
0 commit comments