Opened 4 months ago
Last modified 2 days ago
#64226 new task (blessed)
Coding Standards fixes for WP 7.0
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch |
| Focuses: | coding-standards | Cc: |
Change History (20)
This ticket was mentioned in PR #3198 on WordPress/wordpress-develop by @costdev.
4 months ago
#1
- Keywords has-patch added
This ticket was mentioned in PR #10147 on WordPress/wordpress-develop by @mukesh27.
4 months ago
#2
@SergeyBiryukov commented on PR #3198:
4 months ago
#4
Thanks for the PR! Merged in r61224.
This ticket was mentioned in PR #10650 on WordPress/wordpress-develop by @peterwilsoncc.
2 months ago
#8
Renames the get_bloginfo(_rss?) $show parameter to $site_info as the functions don't show (ie, echo) the argument but return it.
Trac ticket: https://core.trac.wordpress.org/ticket/64226
#9
follow-up:
↓ 10
@
2 months ago
I'm in two minds about PR#10650.
It renames the $show parameter in the get_bloginfo(_rss)? functions to $site_info as the functions return the values rather than output them. To me, $show suggests the result is echoed.
@SergeyBiryukov Do you have thoughts on this?
This ticket was mentioned in PR #10780 on WordPress/wordpress-develop by @huzaifaalmesbah.
6 weeks ago
#11
This PR updates variable names in wp-admin includes to strictly adhere to WordPress Coding Standards (lowercase with underscores, no unnecessary abbreviations). These changes focus on local variables to avoid backward compatibility issues.
Trac ticket: https://core.trac.wordpress.org/ticket/64226
### Changes
- src/wp-admin/includes/post.php: Renamed
$id3datato$id3_datain edit_post(). - src/wp-admin/includes/media.php: Renamed
$extto$extensionand$ext_typeto$extension_typein media_handle_upload() and media_send_to_editor(). - src/wp-admin/includes/image-edit.php: Renamed
$extto$extensionin wp_image_editor().
### Testing Instructions
- Media Upload: Upload image, audio, and video files. Ensure uploads complete successfully and correct icons/metadata are displayed.
- Image Editing: Go to Media Library, select an image, click "Edit Image", perform a crop or rotation, and save. Confirm the edit is applied successfully.
- General Admin: Edit a post and verify the page loads and saves correctly without any PHP notices or errors.
This ticket was mentioned in PR #10786 on WordPress/wordpress-develop by @huzaifaalmesbah.
6 weeks ago
#12
Removes three instances of comments in src/wp-content/themes/twentytwentyfour/functions.php
that duplicate the function summaries in the DocBlocks immediately following them.
## Rationale
The comments “Register block styles.”, “Enqueue block stylesheets.”, and “Register pattern categories.” are unnecessary because the DocBlocks for the following functions already clearly describe their purposes:
twentytwentyfour_block_stylestwentytwentyfour_block_stylesheetstwentytwentyfour_pattern_categories
Removing these duplicate comments improves code cleanliness and avoids redundant documentation.
@SergeyBiryukov commented on PR #10786:
5 weeks ago
#14
Thanks for the PR! Merged in r61552.
This ticket was mentioned in PR #10899 on WordPress/wordpress-develop by @sabernhardt.
3 weeks ago
#15
Removes the redundant docblock-style comment before function_exists(), and pluralizes "Patterns" in the function summary for twenty_twenty_one_register_block_pattern().
Props: huzaifaalmesbah
@SergeyBiryukov commented on PR #10899:
3 weeks ago
#17
Thanks for the PR! Merged in r61608.
This ticket was mentioned in PR #11111 on WordPress/wordpress-develop by @Soean.
2 days ago
#18
Trac ticket: https://core.trac.wordpress.org/ticket/64226
@westonruter commented on PR #11111:
2 days ago
#20
Committed in r61790 (976ca47)
Per naming conventions, don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.
See PHP Coding Standards - Naming Conventions.
This PR includes renaming of the following variables:
$post_IDto$post_id. - "Use lowercase letters in variable, action/filter, and function names"$ext_typeto$extension_type.$extto$extension.$id3datato$id3_data. - "Separate words via underscores."$msgto$message.$sbto$sidebar.$altto$alternate.$pidto$post_id.$menu_objto$menu_object.$noparentsto$no_parents. - "Separate words via underscores."$supto$supplemental.$cat_idto$category_id.$cat_nameto$category_name.$outto$output.$rto$edit_result.$tto$taxonomy.$uto$update_result.$rto$result.$responseto$response_data.$xto$response.Trac ticket:
https://core.trac.wordpress.org/ticket/64226
https://core.trac.wordpress.org/ticket/63168
https://core.trac.wordpress.org/ticket/55647