wp/wp-admin/import.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    27 	)
    27 	)
    28 );
    28 );
    29 
    29 
    30 get_current_screen()->set_help_sidebar(
    30 get_current_screen()->set_help_sidebar(
    31 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    31 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    32 	'<p>' . __( '<a href="https://wordpress.org/support/article/tools-import-screen/">Documentation on Import</a>' ) . '</p>' .
    32 	'<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-import-screen/">Documentation on Import</a>' ) . '</p>' .
    33 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    33 	'<p>' . __( '<a href="https://wordpress.org/support/forums">Support</a>' ) . '</p>'
    34 );
    34 );
    35 
    35 
    36 if ( current_user_can( 'install_plugins' ) ) {
    36 if ( current_user_can( 'install_plugins' ) ) {
    37 	// List of popular importer plugins from the WordPress.org API.
    37 	// List of popular importer plugins from the WordPress.org API.
    38 	$popular_importers = wp_get_popular_importers();
    38 	$popular_importers = wp_get_popular_importers();
    58 $parent_file = 'tools.php';
    58 $parent_file = 'tools.php';
    59 ?>
    59 ?>
    60 
    60 
    61 <div class="wrap">
    61 <div class="wrap">
    62 <h1><?php echo esc_html( $title ); ?></h1>
    62 <h1><?php echo esc_html( $title ); ?></h1>
    63 <?php if ( ! empty( $_GET['invalid'] ) ) : ?>
    63 <?php
    64 	<div class="error">
    64 if ( ! empty( $_GET['invalid'] ) ) :
    65 		<p><strong><?php _e( 'Error:' ); ?></strong>
    65 	$importer_not_installed = '<strong>' . __( 'Error:' ) . '</strong> ' . sprintf(
    66 			<?php
    66 		/* translators: %s: Importer slug. */
    67 			/* translators: %s: Importer slug. */
    67 		__( 'The %s importer is invalid or is not installed.' ),
    68 			printf( __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' );
    68 		'<strong>' . esc_html( $_GET['invalid'] ) . '</strong>'
    69 			?>
    69 	);
    70 		</p>
    70 	wp_admin_notice(
    71 	</div>
    71 		$importer_not_installed,
    72 <?php endif; ?>
    72 		array(
       
    73 			'additional_classes' => array( 'error' ),
       
    74 		)
       
    75 	);
       
    76 endif;
       
    77 ?>
    73 <p><?php _e( 'If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:' ); ?></p>
    78 <p><?php _e( 'If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:' ); ?></p>
    74 
    79 
    75 <?php
    80 <?php
    76 // Registered (already installed) importers. They're stored in the global $wp_importers.
    81 // Registered (already installed) importers. They're stored in the global $wp_importers.
    77 $importers = get_importers();
    82 $importers = get_importers();
   156 						esc_url( $url ),
   161 						esc_url( $url ),
   157 						esc_attr( $plugin_slug ),
   162 						esc_attr( $plugin_slug ),
   158 						esc_attr( $data[0] ),
   163 						esc_attr( $data[0] ),
   159 						/* translators: %s: Importer name. */
   164 						/* translators: %s: Importer name. */
   160 						esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ),
   165 						esc_attr( sprintf( _x( 'Install %s now', 'plugin' ), $data[0] ) ),
   161 						__( 'Install Now' )
   166 						_x( 'Install Now', 'plugin' )
   162 					);
   167 					);
   163 				} else {
   168 				} else {
   164 					$action = sprintf(
   169 					$action = sprintf(
   165 						/* translators: %s: URL to Import screen on the main site. */
   170 						/* translators: %s: URL to Import screen on the main site. */
   166 						__( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ),
   171 						__( 'This importer is not installed. Please install importers from <a href="%s">the main site</a>.' ),