diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/export.php --- 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 @@ ?> set_help_sidebar( '

' . __( 'For more information:' ) . '

' . - '

' . __( 'Documentation on Export' ) . '

' . + '

' . __( 'Documentation on Export' ) . '

' . '

' . __( 'Support' ) . '

' ); @@ -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 @@

-

+