Skip to content

Commit

Permalink
Update wordcamp-new-site.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dd32 authored Jul 25, 2024
1 parent ff7727d commit 64741f5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ public function render_site_url_field( $key, $field_type, $object_name ) {
$valid_url = isset( $url['host'], $url['path'] );
$tld = get_top_level_domain();
$network_id = $valid_url && "events.wordpress.$tld" === $url['host'] ? EVENTS_NETWORK_ID : WORDCAMP_NETWORK_ID;
$doaction = ( 'doaction.org' === $url['host'] );
$we_host_it = ( 'doaction.org' !== $url['host'] );
?>

<?php if ( $valid_url && ! $doaction && domain_exists( $url['host'], $url['path'], $network_id ) ) : ?>
<?php if ( $valid_url && $we_host_it && domain_exists( $url['host'], $url['path'], $network_id ) ) : ?>
<?php
$blog_details = get_blog_details(
array(
Expand All @@ -76,7 +76,7 @@ public function render_site_url_field( $key, $field_type, $object_name ) {
<a target="_blank" href="<?php echo esc_url( $blog_details->siteurl ); ?>/wp-admin/">Dashboard</a> |
<a target="_blank" href="<?php echo esc_url( $blog_details->siteurl ); ?>">Visit</a>

<?php else if ( ! $doaction ) : ?>
<?php else if ( $we_host_it ) : ?>
<?php $checkbox_id = wcpt_key_to_str( 'create-site-in-network', 'wcpt_' ); ?>

<label for="<?php echo esc_attr( $checkbox_id ); ?>">
Expand Down Expand Up @@ -171,9 +171,9 @@ public static function url_matches_expected_format( $domain, $path, $wordcamp_id
$is_external_domain = ! preg_match( "@ \.wordcamp\.$tld | \.buddycamp\.$tld | events\.wordpress\.$tld @ix", $domain );
$can_have_external_domain = $wordcamp_id <= $last_permitted_external_domain || in_array( $wordcamp_id, $external_domain_exceptions );

// DoAction is not hosted within the WordCamp infrastructure, so we don't need to validate it.
// DoAction is not hosted within the WordCamp infrastructure, so can have an external domain.
if ( 'doaction.org' === $domain ) {
return true;
$can_have_external_domain = true;
}

if ( $is_external_domain && $can_have_external_domain ) {
Expand Down

0 comments on commit 64741f5

Please sign in to comment.