<div class="wrap">
	<h1><?php _e( 'Custom Post Type Cleanup', 'custom-post-type-cleanup' ); ?></h1>
	<?php echo $notice; ?>
	<p>
	<?php _e( 'Delete posts from unused custom post types.', 'custom-post-type-cleanup' ); ?>
	(<?php echo $doc_link; ?>)
	</p>
	<hr>
	<h3>
		<?php _e( 'Delete Posts', 'custom-post-type-cleanup' ); ?>
	</h3>
	<h4>
		<?php
		/* translators: 1: Total post count, 2: Custom post type count, 3: 'custom post type' or 'custom post types' (single/plural) */
		printf( _n( '%1$d post from %2$d unused %3$s detected!', '%1$d posts from %2$d unused %3$s detected!', $total, 'custom-post-type-cleanup' ), $total, $type_count, $type_str );
		?>
	</h4>
	<p>
		<?php _e( "It's recommended you <strong style='font-weight:bold; color:red;'>make a database backup</strong> before deleting posts.", 'custom-post-type-cleanup' ); ?>
	</p>

	<form method="post" action="">
		<?php wp_nonce_field( 'custom_post_type_cleanup_nonce', 'security' ); ?>
		<table class='form-table'>
			<tr>
				<th scope='row'>
					<label for="cptc_post_type">
						<?php _ex( 'Unused post type', 'Form label text for post type', 'custom-post-type-cleanup' ); ?>:
					</label>
				</th>
				<td>
					<select id="cptc_post_type" name="cptc_post_type">
						<?php echo $options; ?>
					</select>
					<p class="description">
						<?php _e( 'The post type you want to delete posts from.', 'custom-post-type-cleanup' ); ?>
					</p>
				</td>
			</tr>
			<tr>
				<th scope='row'>
					<label for="cptc_batch_size">
						<?php _ex( 'Batch size', 'Form label text for batch size', 'custom-post-type-cleanup' ); ?>:
					</label>
				</th>
				<td>
					<input type="number" name="cptc_batch_size" id="cptc_batch_size" step="1" min="1" value="<?php echo $batch_size; ?>"/>
					<p class="description">
						<?php _e( 'Number of posts to delete.', 'custom-post-type-cleanup' ); ?>
						<?php _e( 'Default 100.', 'custom-post-type-cleanup' ); ?>
					</p>
				</td>
			</tr>
		</table>
		<input id="cptc_delete" class="button button-primary" name="cptc_delete" value="<?php _e('Delete Posts!', 'custom-post-type-cleanup'); ?>" type="submit">
		<p class="description" style="margin-top: 1em; margin-bottom: 1em;" >
			<?php
				/* translators: %d: Batch size */
				printf( __( 'Posts are deleted in batches of %d posts.', 'custom-post-type-cleanup' ), $batch_size );
			?>
		</p>
		<hr>
		<h3>
			<?php _e( 'Re-register unused custom post types', 'custom-post-type-cleanup' ); ?>
		</h3>
		<p>
			<?php _e( 'Register unused custom post types for a limited time to inspect or delete the posts in the wp-admin itself.', 'custom-post-type-cleanup' ); ?>
		</p>
		<p>
			<?php _e( '<strong>Note</strong>: The custom post type posts can not be viewed in the front side of your website.', 'custom-post-type-cleanup' ); ?>
		</p>
		<p>
			<input class="button button-primary" name="cptc_register" value="<?php printf ( __( 'Register all unused custom post types for the next %s minutes', 'custom-post-type-cleanup' ), $transient_time ); ?>" type="submit">
		</p>
	</form>
	<hr>
	<p>
		<?php
			/* translators: %s: plugin link */
			printf( __( 'This page is generated by the %s plugin.', 'custom-post-type-cleanup' ), $plugin_link );
		?>
	</p>
</div>
