Making WordPress.org

Changeset 14696


Ignore:
Timestamp:
03/10/2026 03:39:22 PM (6 weeks ago)
Author:
obenland
Message:

Login: Fix URLs resolving to login subsite instead of wordpress.org.

Use get_rest_url() and get_admin_url() with explicit blog IDs so the
MCP config and My Sites link point to the main site rather than the
login subsite. Also correct the site_url scheme from login_post to login.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/login-application-passwords
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/login-application-passwords/clients/mcp/class-mcp-authorization.php

    r14682 r14696  
    7070                    'args'    => array( '-y', '@automattic/mcp-wordpress-remote@latest' ),
    7171                    'env'     => array(
    72                         'WP_API_URL'      => rest_url( 'mcp/wporg' ),
     72                        'WP_API_URL'      => get_rest_url( 1, 'mcp/wporg' ),
    7373                        'WP_API_USERNAME' => $user->user_login,
    7474                        'WP_API_PASSWORD' => WP_Application_Passwords::chunk_password( $new_password ),
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/login-application-passwords/login-application-passwords.php

    r14682 r14696  
    249249
    250250    ?>
    251     <form action="<?php echo esc_url( site_url( 'wp-login.php?action=authorize_application', 'login_post' ) ); ?>" method="post" class="authorize-application-form">
     251    <form action="<?php echo esc_url( site_url( 'wp-login.php?action=authorize_application', 'login' ) ); ?>" method="post" class="authorize-application-form">
    252252        <?php wp_nonce_field( 'authorize_application_password' ); ?>
    253253        <input type="hidden" name="wp_action" value="authorize_application_password" />
     
    318318                        }
    319319
    320                         printf( wp_kses_post( $message ), esc_url( admin_url( 'my-sites.php' ) ), esc_html( number_format_i18n( $blogs_count ) ) );
     320                        printf( wp_kses_post( $message ), esc_url( get_admin_url( array_key_first( $blogs ), 'my-sites.php' ) ), esc_html( number_format_i18n( $blogs_count ) ) );
    321321                        ?>
    322322                    </p>
Note: See TracChangeset for help on using the changeset viewer.