wp/wp-admin/options-permalink.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    11 
    11 
    12 if ( ! current_user_can( 'manage_options' ) ) {
    12 if ( ! current_user_can( 'manage_options' ) ) {
    13 	wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
    13 	wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
    14 }
    14 }
    15 
    15 
       
    16 // Used in the HTML title tag.
    16 $title       = __( 'Permalink Settings' );
    17 $title       = __( 'Permalink Settings' );
    17 $parent_file = 'options-general.php';
    18 $parent_file = 'options-general.php';
    18 
    19 
    19 get_current_screen()->add_help_tab(
    20 get_current_screen()->add_help_tab(
    20 	array(
    21 	array(
    53 		'content' => '<p>' . __( 'The Optional fields let you customize the &#8220;category&#8221; and &#8220;tag&#8221; base names that will appear in archive URLs. For example, the page listing all posts in the &#8220;Uncategorized&#8221; category could be <code>/topics/uncategorized</code> instead of <code>/category/uncategorized</code>.' ) . '</p>' .
    54 		'content' => '<p>' . __( 'The Optional fields let you customize the &#8220;category&#8221; and &#8220;tag&#8221; base names that will appear in archive URLs. For example, the page listing all posts in the &#8220;Uncategorized&#8221; category could be <code>/topics/uncategorized</code> instead of <code>/category/uncategorized</code>.' ) . '</p>' .
    54 			'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
    55 			'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
    55 	)
    56 	)
    56 );
    57 );
    57 
    58 
    58 get_current_screen()->set_help_sidebar(
    59 $help_sidebar_content = '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    59 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    60 						'<p>' . __( '<a href="https://wordpress.org/support/article/settings-permalinks-screen/">Documentation on Permalinks Settings</a>' ) . '</p>' .
    60 	'<p>' . __( '<a href="https://wordpress.org/support/article/settings-permalinks-screen/">Documentation on Permalinks Settings</a>' ) . '</p>' .
    61 						'<p>' . __( '<a href="https://wordpress.org/support/article/using-permalinks/">Documentation on Using Permalinks</a>' ) . '</p>';
    61 	'<p>' . __( '<a href="https://wordpress.org/support/article/using-permalinks/">Documentation on Using Permalinks</a>' ) . '</p>' .
    62 
    62 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    63 if ( $is_nginx ) {
    63 );
    64 	$help_sidebar_content .= '<p>' . __( '<a href="https://wordpress.org/support/article/nginx/">Documentation on Nginx configuration</a>.' ) . '</p>';
       
    65 }
       
    66 
       
    67 $help_sidebar_content .= '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>';
       
    68 
       
    69 get_current_screen()->set_help_sidebar( $help_sidebar_content );
       
    70 unset( $help_sidebar_content );
    64 
    71 
    65 $home_path           = get_home_path();
    72 $home_path           = get_home_path();
    66 $iis7_permalinks     = iis7_supports_permalinks();
    73 $iis7_permalinks     = iis7_supports_permalinks();
    67 $permalink_structure = get_option( 'permalink_structure' );
    74 $permalink_structure = get_option( 'permalink_structure' );
    68 
    75 
   358 			if ( file_exists( $home_path . 'web.config' ) ) :
   365 			if ( file_exists( $home_path . 'web.config' ) ) :
   359 				?>
   366 				?>
   360 <p id="iis-description-a">
   367 <p id="iis-description-a">
   361 				<?php
   368 				<?php
   362 				printf(
   369 				printf(
   363 					/* translators: 1: web.config, 2: Documentation URL, 3: CTRL + a, 4: Element code. */
   370 					/* translators: 1: web.config, 2: Documentation URL, 3: Ctrl + A, 4: ⌘ + A, 5: Element code. */
   364 					__( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %1$s file. Click in the field and press %3$s to select all. Then insert this rule inside of the %4$s element in %1$s file.' ),
   371 					__( '<strong>Error:</strong> Your %1$s file is not <a href="%2$s">writable</a>, so updating it automatically was not possible. This is the URL rewrite rule you should have in your %1$s file. Click in the field and press %3$s (or %4$s on Mac) to select all. Then insert this rule inside of the %5$s element in %1$s file.' ),
   365 					'<code>web.config</code>',
   372 					'<code>web.config</code>',
   366 					__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
   373 					__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
   367 					'<kbd>CTRL + a</kbd>',
   374 					'<kbd>Ctrl + A</kbd>',
       
   375 					'<kbd>⌘ + A</kbd>',
   368 					'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
   376 					'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
   369 				);
   377 				);
   370 				?>
   378 				?>
   371 </p>
   379 </p>
   372 <form action="options-permalink.php" method="post">
   380 <form action="options-permalink.php" method="post">
   375 </form>
   383 </form>
   376 <p>
   384 <p>
   377 				<?php
   385 				<?php
   378 				printf(
   386 				printf(
   379 					/* translators: %s: web.config */
   387 					/* translators: %s: web.config */
   380 					__( 'If you temporarily make your %s file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.' ),
   388 					__( 'If you temporarily make your %s file writable to generate rewrite rules automatically, do not forget to revert the permissions after the rule has been saved.' ),
   381 					'<code>web.config</code>'
   389 					'<code>web.config</code>'
   382 				);
   390 				);
   383 				?>
   391 				?>
   384 </p>
   392 </p>
   385 		<?php else : ?>
   393 		<?php else : ?>
   386 <p id="iis-description-b">
   394 <p id="iis-description-b">
   387 			<?php
   395 			<?php
   388 			printf(
   396 			printf(
   389 				/* translators: 1: Documentation URL, 2: web.config, 3: CTRL + a */
   397 				/* translators: 1: Documentation URL, 2: web.config, 3: Ctrl + A, 4: ⌘ + A */
   390 				__( 'If the root directory of your site was <a href="%1$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %2$s file. Create a new file, called %2$s in the root directory of your site. Click in the field and press %3$s to select all. Then insert this code into the %2$s file.' ),
   398 				__( '<strong>Error:</strong> The root directory of your site is not <a href="%1$s">writable</a>, so creating a file automatically was not possible. This is the URL rewrite rule you should have in your %2$s file. Create a new file called %2$s in the root directory of your site. Click in the field and press %3$s (or %4$s on Mac) to select all. Then insert this code into the %2$s file.' ),
   391 				__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
   399 				__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
   392 				'<code>web.config</code>',
   400 				'<code>web.config</code>',
   393 				'<kbd>CTRL + a</kbd>'
   401 				'<kbd>Ctrl + A</kbd>',
       
   402 				'<kbd>⌘ + A</kbd>'
   394 			);
   403 			);
   395 			?>
   404 			?>
   396 </p>
   405 </p>
   397 <form action="options-permalink.php" method="post">
   406 <form action="options-permalink.php" method="post">
   398 			<?php wp_nonce_field( 'update-permalink' ); ?>
   407 			<?php wp_nonce_field( 'update-permalink' ); ?>
   400 </form>
   409 </form>
   401 <p>
   410 <p>
   402 			<?php
   411 			<?php
   403 			printf(
   412 			printf(
   404 				/* translators: %s: web.config */
   413 				/* translators: %s: web.config */
   405 				__( 'If you temporarily make your site&#8217;s root directory writable for us to generate the %s file automatically, do not forget to revert the permissions after the file has been created.' ),
   414 				__( 'If you temporarily make your site&#8217;s root directory writable to generate the %s file automatically, do not forget to revert the permissions after the file has been created.' ),
   406 				'<code>web.config</code>'
   415 				'<code>web.config</code>'
   407 			);
   416 			);
   408 			?>
   417 			?>
   409 </p>
   418 </p>
   410 		<?php endif; ?>
   419 		<?php endif; ?>
   411 	<?php endif; ?>
   420 	<?php endif; ?>
   412 <?php elseif ( $is_nginx ) : ?>
   421 		<?php
   413 	<p><?php _e( '<a href="https://wordpress.org/support/article/nginx/">Documentation on Nginx configuration</a>.' ); ?></p>
       
   414 	<?php
       
   415 else :
   422 else :
   416 	if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $htaccess_update_required ) :
   423 	if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $htaccess_update_required ) :
   417 		?>
   424 		?>
   418 <p id="htaccess-description">
   425 <p id="htaccess-description">
   419 		<?php
   426 		<?php
   420 		printf(
   427 		printf(
   421 			/* translators: 1: .htaccess, 2: Documentation URL, 3: CTRL + a */
   428 			/* translators: 1: .htaccess, 2: Documentation URL, 3: Ctrl + A, 4: ⌘ + A */
   422 			__( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s to select all.' ),
   429 			__( '<strong>Error:</strong> Your %1$s file is not <a href="%2$s">writable</a>, so updating it automatically was not possible. These are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s (or %4$s on Mac) to select all.' ),
   423 			'<code>.htaccess</code>',
   430 			'<code>.htaccess</code>',
   424 			__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
   431 			__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
   425 			'<kbd>CTRL + a</kbd>'
   432 			'<kbd>Ctrl + A</kbd>',
       
   433 			'<kbd>⌘ + A</kbd>'
   426 		);
   434 		);
   427 		?>
   435 		?>
   428 </p>
   436 </p>
   429 <form action="options-permalink.php" method="post">
   437 <form action="options-permalink.php" method="post">
   430 		<?php wp_nonce_field( 'update-permalink' ); ?>
   438 		<?php wp_nonce_field( 'update-permalink' ); ?>