[wp-trac] [WordPress Trac] #60032: $body_id global variable return value to string not int.

WordPress Trac noreply at wordpress.org
Tue Feb 13 11:46:06 UTC 2024


#60032: $body_id global variable return value to string not int.
-----------------------------------------+-------------------------------
 Reporter:  upadalavipul                 |       Owner:  SergeyBiryukov
     Type:  defect (bug)                 |      Status:  closed
 Priority:  normal                       |   Milestone:  6.5
Component:  General                      |     Version:  4.3
 Severity:  normal                       |  Resolution:  fixed
 Keywords:  has-patch changes-requested  |     Focuses:  coding-standards
-----------------------------------------+-------------------------------

Comment (by sukacynono1957):

 If the `$body_id` global variable in `wp-admin/includes/media.php` is
 returning a value of type integer, but the comments suggest it should
 return a string, then indeed, there might be a discrepancy between the
 expected and actual behavior.

 To ensure clarity and consistency, you should update the comments to
 accurately reflect the type of value returned by the `$body_id` global
 variable.

 Here's an example of how you might update the comment:

 ```php
 /**
  * ID attribute for the body element in the media library.
  *
  * @global int $body_id The ID attribute for the body element. This should
 be a string value.
  */
 ```

 By making this change, you're helping to maintain code clarity and
 ensuring that other developers who work with this code understand the
 expected data type of the `$body_id` global variable.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60032#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list