WordPress.org

Make WordPress Core

Ticket #38085: 38085.2.patch

File 38085.2.patch, 1020 bytes (added by johnjamesjacoby, 3 years ago)

Whitespace, and skip if get_author_posts_url() returns an empty result (thanks to a mutable filter at the end)

  • src/wp-admin/includes/class-wp-users-list-table.php

    diff --git src/wp-admin/includes/class-wp-users-list-table.php src/wp-admin/includes/class-wp-users-list-table.php
    index 3b7795d..f7ac6b8 100644
     
    413413                        if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
    414414                                $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&amp;user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
    415415
     416                        // Set up the view user link, if not empty
     417                        if ( $author_posts_url = get_author_posts_url( $user_object->ID ) ) {
     418                                $view_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), $author_posts_url ) );
     419                                $actions['view'] = '<a href="' . $view_link . '">' . __('View') . '</a>';
     420                        }
     421
    416422                        /**
    417423                         * Filters the action links displayed under each user in the Users list table.
    418424                         *