Skip to content

Commit

Permalink
Coding Standards: Remove an extra variable in get_author_posts_url().
Browse files Browse the repository at this point in the history
This fixes a `Variable "$auth_ID" is not in valid snake_case format` WPCS warning by using the existing `$author_id` variable, and brings consistency with a similar fragment in `get_author_feed_link()`.

Follow-up to [979], [5087], [6364], [6365].

See #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@52568 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 12, 2022
1 parent 7bec2e6 commit 0b010f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/wp-includes/author-template.php
Expand Up @@ -343,12 +343,13 @@ function the_author_posts_link( $deprecated = '' ) {
*/
function get_author_posts_url( $author_id, $author_nicename = '' ) {
global $wp_rewrite;
$auth_ID = (int) $author_id;
$link = $wp_rewrite->get_author_permastruct();

$author_id = (int) $author_id;
$link = $wp_rewrite->get_author_permastruct();

if ( empty( $link ) ) {
$file = home_url( '/' );
$link = $file . '?author=' . $auth_ID;
$link = $file . '?author=' . $author_id;
} else {
if ( '' === $author_nicename ) {
$user = get_userdata( $author_id );
Expand Down

0 comments on commit 0b010f1

Please sign in to comment.