Skip to content

Conversation

@costdev
Copy link
Contributor

@costdev costdev commented Sep 5, 2022

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

@costdev costdev force-pushed the rename_short_abbreviated_variables_wp-admin_includes_ajax-actions branch from 427b7bc to b50eed1 Compare September 5, 2022 23:05
costdev added 20 commits September 6, 2022 00:28
…ax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…es/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…ax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…ax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…/includes/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…ludes/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…des/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…ncludes/ajax-actions.php`.

Per naming conventions, separate words via underscores.
…ncludes/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…jax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…/ajax-actions.php`.

As this is not used for an image's `alt` attribute, using an abbreviation
here creates ambiguity.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…ax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…jax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…des/ajax-actions.php`.

Per naming conventions, separate words via underscores.
…/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…n/includes/ajax-actions.php`.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
…es/ajax-actions.php`.

Per naming conventions, use lowercase letters in variable, action/filter,
and function names (never camelCase).
…actions.php`.

Note:
This variable is initialized to `0` and used only once.
Normally, the value would be passed directly at the point of usage.

However, this variable is passed to `_list_meta_row()`,
which accepts the `$count` argument by reference.
Only variables can be passed by reference.

Per naming conventions, don’t abbreviate variable names unnecessarily;
let the code be unambiguous and self-documenting.
@costdev costdev force-pushed the rename_short_abbreviated_variables_wp-admin_includes_ajax-actions branch from b50eed1 to 18ad209 Compare September 5, 2022 23:29
@costdev costdev marked this pull request as ready for review September 5, 2022 23:42
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @costdev

@SergeyBiryukov
Copy link
Member

Thanks for the PR! Merged in r61224.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants