Make WordPress Core

Opened 4 weeks ago

Last modified 2 weeks ago

#64226 new task (blessed)

Coding Standards fixes for WP 7.0

Reported by: desrosj's profile desrosj Owned by:
Milestone: 7.0 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: coding-standards Cc:

Description

Previously:

Change History (6)

This ticket was mentioned in PR #3198 on WordPress/wordpress-develop by @costdev.


4 weeks ago
#1

  • Keywords has-patch added

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_ID to $post_id. - "Use lowercase letters in variable, action/filter, and function names"
  • $ext_type to $extension_type.
  • $ext to $extension.
  • $id3data to $id3_data. - "Separate words via underscores."
  • $msg to $message.
  • $sb to $sidebar.
  • $alt to $alternate.
  • $pid to $post_id.
  • $menu_obj to $menu_object.
  • $noparents to $no_parents. - "Separate words via underscores."
  • $sup to $supplemental.
  • $cat_id to $category_id.
  • $cat_name to $category_name.
  • $out to $output.
  • $r to $edit_result.
  • $t to $taxonomy.
  • $u to $update_result.
  • $r to $result.
  • $response to $response_data.
  • $x to $response.

Trac ticket:
https://core.trac.wordpress.org/ticket/64226
https://core.trac.wordpress.org/ticket/63168
https://core.trac.wordpress.org/ticket/55647

#3 @SergeyBiryukov
4 weeks ago

In 61224:

Coding Standards: Use more meaningful variable names in Admin Ajax actions.

Per the Naming Conventions:

Don’t abbreviate variable names unnecessarily; let the code be unambiguous and self-documenting.

This commit includes renaming of the following variables:

  • $post_ID to $post_id — “Use lowercase letters in variable, action/filter, and function names”.
  • $ext_type to $extension_type.
  • $ext to $extension.
  • $id3data to $id3_data — “Separate words via underscores”.
  • $msg to $message.
  • $sb to $sidebar.
  • $alt to $alternate.
  • $pid to $post_id.
  • $mid to $meta_id.
  • $menu_obj to $menu_object.
  • $noparents to $no_parents — “Separate words via underscores”.
  • $sup to $supplemental.
  • $cat_id to $category_id.
  • $cat_name to $category_name.
  • $out to $output.
  • $r to $edit_result.
  • $t to $taxonomy.
  • $u to $update_result.
  • $r to $result.
  • $response to $response_data.
  • $x to $response.

Follow-up to [53723], [55365].

Props costdev, mukesh27, SergeyBiryukov.
See #64226.

@SergeyBiryukov commented on PR #3198:


4 weeks ago
#4

Thanks for the PR! Merged in r61224.

#5 @westonruter
3 weeks ago

In 61272:

Twenty Twenty-Five: Remove redundant comments for conditionally-defined functions.

This also improves consistency with other themes.

Follow-up to [59146].

Fixes #64265.
See #64226.
Props hbhalodia, huzaifaalmesbah.

#6 @westonruter
2 weeks ago

In 61298:

Docs: Update typing for wp_create_category().

  • Ensure that wp_create_category() returns int as opposed to numeric-string.
  • Rename $cat_name to $category_name to avoid abbreviating variables.
  • Update docblock to remove erroneous int for $category_name param when only string is intended.
  • Add missing tests for wp_create_category().

Developed in https://github.com/WordPress/wordpress-develop/pull/8861

Props justlevine, westonruter.
See #64238, #64226.

Note: See TracTickets for help on using tickets.