Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow doaction.org URLs for events #1350

Merged
merged 5 commits into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +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;
$we_host_it = $valid_url && 'doaction.org' !== $url['host'];
?>

<?php if ( $valid_url && 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 @@ -75,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 : ?>
<?php elseif ( $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 @@ -170,6 +171,11 @@ 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 can have an external domain.
if ( 'doaction.org' === $domain ) {
$can_have_external_domain = true;
}

if ( $is_external_domain && $can_have_external_domain ) {
// Many old camps had external websites.
return true;
Expand Down
Loading