Making WordPress.org


Ignore:
Timestamp:
02/10/2022 09:38:45 AM (3 years ago)
Author:
dd32
Message:

Trac: Add the ability to include Tickets that you've added a GitHub PR to, in the 'my patches' reports.

See https://core.trac.wordpress.org/my-patches + https://meta.trac.wordpress.org/report/12
Fixes #5596.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/functions.php

    r11255 r11544  
    103103 * Find a WordPress.org user by a Github login.
    104104 */
    105 function find_wporg_user_by_github( $github_user ) {
     105function find_wporg_user_by_github( $github_user, $what = 'user_login' ) {
    106106    global $wpdb;
    107107
     108    if ( ! in_array( $what, [ 'ID', 'user_login' ], true ) ) {
     109        return false;
     110    }
     111
    108112    return $wpdb->get_var( $wpdb->prepare(
    109         "SELECT u.user_login
     113        "SELECT u.{$what}
    110114            FROM wporg_github_users g
    111115                JOIN {$wpdb->users} u ON g.user_id = u.ID
Note: See TracChangeset for help on using the changeset viewer.