wp/wp-admin/export.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-admin/export.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-admin/export.php	Tue Dec 15 13:49:49 2020 +0100
@@ -7,14 +7,14 @@
  */
 
 /** Load WordPress Bootstrap */
-require_once( dirname( __FILE__ ) . '/admin.php' );
+require_once __DIR__ . '/admin.php';
 
 if ( ! current_user_can( 'export' ) ) {
 	wp_die( __( 'Sorry, you are not allowed to export the content of this site.' ) );
 }
 
 /** Load WordPress export API */
-require_once( ABSPATH . 'wp-admin/includes/export.php' );
+require_once ABSPATH . 'wp-admin/includes/export.php';
 $title = __( 'Export' );
 
 /**
@@ -26,17 +26,17 @@
 	?>
 <script type="text/javascript">
 	jQuery(document).ready(function($){
-		 var form = $('#export-filters'),
-			 filters = form.find('.export-filters');
-		 filters.hide();
-		 form.find('input:radio').change(function() {
+		var form = $('#export-filters'),
+			filters = form.find('.export-filters');
+		filters.hide();
+		form.find('input:radio').change(function() {
 			filters.slideUp('fast');
 			switch ( $(this).val() ) {
 				case 'attachment': $('#attachment-filters').slideDown(); break;
 				case 'posts': $('#post-filters').slideDown(); break;
 				case 'pages': $('#page-filters').slideDown(); break;
 			}
-		 });
+		});
 	});
 </script>
 	<?php
@@ -54,7 +54,7 @@
 
 get_current_screen()->set_help_sidebar(
 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
-	'<p>' . __( '<a href="https://codex.wordpress.org/Tools_Export_Screen">Documentation on Export</a>' ) . '</p>' .
+	'<p>' . __( '<a href="https://wordpress.org/support/article/tools-export-screen/">Documentation on Export</a>' ) . '</p>' .
 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
 );
 
@@ -62,9 +62,9 @@
 if ( isset( $_GET['download'] ) ) {
 	$args = array();
 
-	if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
+	if ( ! isset( $_GET['content'] ) || 'all' === $_GET['content'] ) {
 		$args['content'] = 'all';
-	} elseif ( 'posts' == $_GET['content'] ) {
+	} elseif ( 'posts' === $_GET['content'] ) {
 		$args['content'] = 'post';
 
 		if ( $_GET['cat'] ) {
@@ -83,7 +83,7 @@
 		if ( $_GET['post_status'] ) {
 			$args['status'] = $_GET['post_status'];
 		}
-	} elseif ( 'pages' == $_GET['content'] ) {
+	} elseif ( 'pages' === $_GET['content'] ) {
 		$args['content'] = 'page';
 
 		if ( $_GET['page_author'] ) {
@@ -98,7 +98,7 @@
 		if ( $_GET['page_status'] ) {
 			$args['status'] = $_GET['page_status'];
 		}
-	} elseif ( 'attachment' == $_GET['content'] ) {
+	} elseif ( 'attachment' === $_GET['content'] ) {
 		$args['content'] = 'attachment';
 
 		if ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) {
@@ -122,13 +122,13 @@
 	die();
 }
 
-require_once( ABSPATH . 'wp-admin/admin-header.php' );
+require_once ABSPATH . 'wp-admin/admin-header.php';
 
 /**
  * Create the date options fields for exporting a given post type.
  *
  * @global wpdb      $wpdb      WordPress database abstraction object.
- * @global WP_Locale $wp_locale Date and Time Locale object.
+ * @global WP_Locale $wp_locale WordPress date and time locale object.
  *
  * @since 3.1.0
  *
@@ -144,18 +144,18 @@
 		FROM $wpdb->posts
 		WHERE post_type = %s AND post_status != 'auto-draft'
 		ORDER BY post_date DESC
-	",
+			",
 			$post_type
 		)
 	);
 
 	$month_count = count( $months );
-	if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
+	if ( ! $month_count || ( 1 === $month_count && 0 === (int) $months[0]->month ) ) {
 		return;
 	}
 
 	foreach ( $months as $date ) {
-		if ( 0 == $date->year ) {
+		if ( 0 === (int) $date->year ) {
 			continue;
 		}
 
@@ -180,7 +180,7 @@
 <p><label><input type="radio" name="content" value="all" checked="checked" aria-describedby="all-content-desc" /> <?php _e( 'All content' ); ?></label></p>
 <p class="description" id="all-content-desc"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus, and custom posts.' ); ?></p>
 
-<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
+<p><label><input type="radio" name="content" value="posts" /> <?php _ex( 'Posts', 'post type general name' ); ?></label></p>
 <ul id="post-filters" class="export-filters">
 	<li>
 		<label><span class="label-responsive"><?php _e( 'Categories:' ); ?></span>
@@ -321,4 +321,4 @@
 </form>
 </div>
 
-<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
+<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>