Skip to content

Commit

Permalink
Site Cloner: Warn before cloning into closed camp.
Browse files Browse the repository at this point in the history
This helps to avoid unintentionally overwriting an old site with a new one when the organizer actually intends to clone _from_ the old site _to_ a new one.
  • Loading branch information
iandunn committed Sep 20, 2023
1 parent 6a68c1e commit 71e30ef
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
namespace WordCamp\Site_Cloner;
defined( 'WPINC' ) or die();

$wordcamp = get_wordcamp_post();

?>

<div id="wcsc-cloner">
Expand All @@ -15,6 +17,18 @@
<span id="wcsc-sites-count" class="title-count wcsc-sites-count"></span>
</h3>

<?php if ( 'wcpt-closed' === $wordcamp->post_status ) : ?>
<div class="notice notice-warning">
<p>
<?php echo esc_html( sprintf(
// translators: %s is the name of the WordCamp.
__( '%s has already completed, are you sure you want to overwrite it with styles and settings from another site?', 'wordcamporg' ),
get_wordcamp_name()
) ); ?>
</p>
</div>
<?php endif; ?>

<div class="filters"></div>

<div class="wcsc-search">
Expand Down

0 comments on commit 71e30ef

Please sign in to comment.