Making WordPress.org

Changeset 14325


Ignore:
Timestamp:
12/20/2024 11:19:46 AM (4 weeks ago)
Author:
dd32
Message:

Login: Enable user account creations when the referer is WordCamp.

This allows for WordCamps tickets to continue to be bought.

Per Matt.
See [14320].
See https://github.com/WordPress/wordcamp.org/issues/1450.
See https://wordpress.org/news/2024/12/holiday-break/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php

    r14320 r14325  
    1919    wp_safe_redirect( home_url( '/linkexpired/register-logged-in' ) );
    2020    exit;
     21}
     22
     23$user_registration_available = true;
     24$is_wordcamp_registration    = str_contains( $_COOKIE['wporg_came_from'] ?? ( $_REQUEST['from'] ?? '' ), '.wordcamp.org' );
     25
     26if ( defined( 'WPORG_ON_HOLIDAY' ) && WPORG_ON_HOLIDAY && ! $is_wordcamp_registration ) {
     27    $user_registration_available = false;
    2128}
    2229
     
    4451    $terms_of_service_error = ! $terms_of_service || $terms_of_service > TOS_REVISION;
    4552
    46     $wporg_on_holiday = defined( 'WPORG_ON_HOLIDAY' ) && WPORG_ON_HOLIDAY;
    47 
    4853    // handle user registrations.
    49     if ( ! $wporg_on_holiday && ! $error_user_login && ! $error_user_email && ! $terms_of_service_error ) {
     54    if ( $user_registration_available && ! $error_user_login && ! $error_user_email && ! $terms_of_service_error ) {
    5055
    5156        $recaptcha = wporg_login_check_recapcha_status( 'register', false /* Allow low scores to pass through */ );
     
    7378?>
    7479
    75 <?php if ( defined( 'WPORG_ON_HOLIDAY' ) && WPORG_ON_HOLIDAY ) : ?>
     80<?php if ( ! $user_registration_available ) : ?>
    7681        <p><?php printf( __( 'New user registration is currently unavailable. Please check back after the <a href="%s">holiday break</a>.', 'wporg' ), 'https://wordpress.org/news/2024/12/holiday-break/' ); ?></p>
    7782<?php else: ?>
Note: See TracChangeset for help on using the changeset viewer.