Edit File by line
/home/barbar84/public_h.../wp-admin
File: options-permalink.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Permalink Settings Administration Screen.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/** WordPress Administration Bootstrap */
[8] Fix | Delete
require_once __DIR__ . '/admin.php';
[9] Fix | Delete
[10] Fix | Delete
if ( ! current_user_can( 'manage_options' ) ) {
[11] Fix | Delete
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
$title = __( 'Permalink Settings' );
[15] Fix | Delete
$parent_file = 'options-general.php';
[16] Fix | Delete
[17] Fix | Delete
get_current_screen()->add_help_tab(
[18] Fix | Delete
array(
[19] Fix | Delete
'id' => 'overview',
[20] Fix | Delete
'title' => __( 'Overview' ),
[21] Fix | Delete
'content' => '<p>' . __( 'Permalinks are the permanent URLs to your individual pages and blog posts, as well as your category and tag archives. A permalink is the web address used to link to your content. The URL to each post should be permanent, and never change &#8212; hence the name permalink.' ) . '</p>' .
[22] Fix | Delete
'<p>' . __( 'This screen allows you to choose your permalink structure. You can choose from common settings or create custom URL structures.' ) . '</p>' .
[23] Fix | Delete
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
[24] Fix | Delete
)
[25] Fix | Delete
);
[26] Fix | Delete
[27] Fix | Delete
get_current_screen()->add_help_tab(
[28] Fix | Delete
array(
[29] Fix | Delete
'id' => 'permalink-settings',
[30] Fix | Delete
'title' => __( 'Permalink Settings' ),
[31] Fix | Delete
'content' => '<p>' . __( 'Permalinks can contain useful information, such as the post date, title, or other elements. You can choose from any of the suggested permalink formats, or you can craft your own if you select Custom Structure.' ) . '</p>' .
[32] Fix | Delete
'<p>' . sprintf(
[33] Fix | Delete
/* translators: %s: Percent sign (%). */
[34] Fix | Delete
__( 'If you pick an option other than Plain, your general URL path with structure tags (terms surrounded by %s) will also appear in the custom structure field and your path can be further modified there.' ),
[35] Fix | Delete
'<code>%</code>'
[36] Fix | Delete
) . '</p>' .
[37] Fix | Delete
'<p>' . sprintf(
[38] Fix | Delete
/* translators: 1: %category%, 2: %tag% */
[39] Fix | Delete
__( 'When you assign multiple categories or tags to a post, only one can show up in the permalink: the lowest numbered category. This applies if your custom structure includes %1$s or %2$s.' ),
[40] Fix | Delete
'<code>%category%</code>',
[41] Fix | Delete
'<code>%tag%</code>'
[42] Fix | Delete
) . '</p>' .
[43] Fix | Delete
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
[44] Fix | Delete
)
[45] Fix | Delete
);
[46] Fix | Delete
[47] Fix | Delete
get_current_screen()->add_help_tab(
[48] Fix | Delete
array(
[49] Fix | Delete
'id' => 'custom-structures',
[50] Fix | Delete
'title' => __( 'Custom Structures' ),
[51] Fix | Delete
'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>' .
[52] Fix | Delete
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
[53] Fix | Delete
)
[54] Fix | Delete
);
[55] Fix | Delete
[56] Fix | Delete
get_current_screen()->set_help_sidebar(
[57] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[58] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/settings-permalinks-screen/">Documentation on Permalinks Settings</a>' ) . '</p>' .
[59] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/using-permalinks/">Documentation on Using Permalinks</a>' ) . '</p>' .
[60] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[61] Fix | Delete
);
[62] Fix | Delete
[63] Fix | Delete
$home_path = get_home_path();
[64] Fix | Delete
$iis7_permalinks = iis7_supports_permalinks();
[65] Fix | Delete
$permalink_structure = get_option( 'permalink_structure' );
[66] Fix | Delete
[67] Fix | Delete
$prefix = '';
[68] Fix | Delete
$blog_prefix = '';
[69] Fix | Delete
if ( ! got_url_rewrite() ) {
[70] Fix | Delete
$prefix = '/index.php';
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
/*
[74] Fix | Delete
* In a subdirectory configuration of multisite, the `/blog` prefix is used by
[75] Fix | Delete
* default on the main site to avoid collisions with other sites created on that
[76] Fix | Delete
* network. If the `permalink_structure` option has been changed to remove this
[77] Fix | Delete
* base prefix, WordPress core can no longer account for the possible collision.
[78] Fix | Delete
*/
[79] Fix | Delete
if ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpos( $permalink_structure, '/blog/' ) ) {
[80] Fix | Delete
$blog_prefix = '/blog';
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
$category_base = get_option( 'category_base' );
[84] Fix | Delete
$tag_base = get_option( 'tag_base' );
[85] Fix | Delete
[86] Fix | Delete
$structure_updated = false;
[87] Fix | Delete
$htaccess_update_required = false;
[88] Fix | Delete
[89] Fix | Delete
if ( isset( $_POST['permalink_structure'] ) || isset( $_POST['category_base'] ) ) {
[90] Fix | Delete
check_admin_referer( 'update-permalink' );
[91] Fix | Delete
[92] Fix | Delete
if ( isset( $_POST['permalink_structure'] ) ) {
[93] Fix | Delete
if ( isset( $_POST['selection'] ) && 'custom' !== $_POST['selection'] ) {
[94] Fix | Delete
$permalink_structure = $_POST['selection'];
[95] Fix | Delete
} else {
[96] Fix | Delete
$permalink_structure = $_POST['permalink_structure'];
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
if ( ! empty( $permalink_structure ) ) {
[100] Fix | Delete
$permalink_structure = preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) );
[101] Fix | Delete
if ( $prefix && $blog_prefix ) {
[102] Fix | Delete
$permalink_structure = $prefix . preg_replace( '#^/?index\.php#', '', $permalink_structure );
[103] Fix | Delete
} else {
[104] Fix | Delete
$permalink_structure = $blog_prefix . $permalink_structure;
[105] Fix | Delete
}
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
$permalink_structure = sanitize_option( 'permalink_structure', $permalink_structure );
[109] Fix | Delete
[110] Fix | Delete
$wp_rewrite->set_permalink_structure( $permalink_structure );
[111] Fix | Delete
[112] Fix | Delete
$structure_updated = true;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
if ( isset( $_POST['category_base'] ) ) {
[116] Fix | Delete
$category_base = $_POST['category_base'];
[117] Fix | Delete
[118] Fix | Delete
if ( ! empty( $category_base ) ) {
[119] Fix | Delete
$category_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $category_base ) );
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
$wp_rewrite->set_category_base( $category_base );
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
if ( isset( $_POST['tag_base'] ) ) {
[126] Fix | Delete
$tag_base = $_POST['tag_base'];
[127] Fix | Delete
[128] Fix | Delete
if ( ! empty( $tag_base ) ) {
[129] Fix | Delete
$tag_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $tag_base ) );
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
$wp_rewrite->set_tag_base( $tag_base );
[133] Fix | Delete
}
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
if ( $iis7_permalinks ) {
[137] Fix | Delete
if ( ( ! file_exists( $home_path . 'web.config' ) && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' ) ) {
[138] Fix | Delete
$writable = true;
[139] Fix | Delete
} else {
[140] Fix | Delete
$writable = false;
[141] Fix | Delete
}
[142] Fix | Delete
} elseif ( $is_nginx ) {
[143] Fix | Delete
$writable = false;
[144] Fix | Delete
} else {
[145] Fix | Delete
if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) {
[146] Fix | Delete
$writable = true;
[147] Fix | Delete
} else {
[148] Fix | Delete
$writable = false;
[149] Fix | Delete
$existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) );
[150] Fix | Delete
$new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) );
[151] Fix | Delete
[152] Fix | Delete
$htaccess_update_required = ( $new_rules !== $existing_rules );
[153] Fix | Delete
}
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
$using_index_permalinks = $wp_rewrite->using_index_permalinks();
[157] Fix | Delete
[158] Fix | Delete
if ( $structure_updated ) {
[159] Fix | Delete
$message = __( 'Permalink structure updated.' );
[160] Fix | Delete
[161] Fix | Delete
if ( ! is_multisite() && $permalink_structure && ! $using_index_permalinks ) {
[162] Fix | Delete
if ( $iis7_permalinks ) {
[163] Fix | Delete
if ( ! $writable ) {
[164] Fix | Delete
$message = sprintf(
[165] Fix | Delete
/* translators: %s: web.config */
[166] Fix | Delete
__( 'You should update your %s file now.' ),
[167] Fix | Delete
'<code>web.config</code>'
[168] Fix | Delete
);
[169] Fix | Delete
} else {
[170] Fix | Delete
$message = sprintf(
[171] Fix | Delete
/* translators: %s: web.config */
[172] Fix | Delete
__( 'Permalink structure updated. Remove write access on %s file now!' ),
[173] Fix | Delete
'<code>web.config</code>'
[174] Fix | Delete
);
[175] Fix | Delete
}
[176] Fix | Delete
} elseif ( ! $is_nginx && $htaccess_update_required && ! $writable ) {
[177] Fix | Delete
$message = sprintf(
[178] Fix | Delete
/* translators: %s: .htaccess */
[179] Fix | Delete
__( 'You should update your %s file now.' ),
[180] Fix | Delete
'<code>.htaccess</code>'
[181] Fix | Delete
);
[182] Fix | Delete
}
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
if ( ! get_settings_errors() ) {
[186] Fix | Delete
add_settings_error( 'general', 'settings_updated', $message, 'success' );
[187] Fix | Delete
}
[188] Fix | Delete
[189] Fix | Delete
set_transient( 'settings_errors', get_settings_errors(), 30 );
[190] Fix | Delete
[191] Fix | Delete
wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) );
[192] Fix | Delete
exit;
[193] Fix | Delete
}
[194] Fix | Delete
[195] Fix | Delete
flush_rewrite_rules();
[196] Fix | Delete
[197] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[198] Fix | Delete
?>
[199] Fix | Delete
<div class="wrap">
[200] Fix | Delete
<h1><?php echo esc_html( $title ); ?></h1>
[201] Fix | Delete
[202] Fix | Delete
<form name="form" action="options-permalink.php" method="post">
[203] Fix | Delete
<?php wp_nonce_field( 'update-permalink' ); ?>
[204] Fix | Delete
[205] Fix | Delete
<p>
[206] Fix | Delete
<?php
[207] Fix | Delete
printf(
[208] Fix | Delete
/* translators: %s: Documentation URL. */
[209] Fix | Delete
__( 'WordPress offers you the ability to create a custom URL structure for your permalinks and archives. Custom URL structures can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="%s">number of tags are available</a>, and here are some examples to get you started.' ),
[210] Fix | Delete
__( 'https://wordpress.org/support/article/using-permalinks/' )
[211] Fix | Delete
);
[212] Fix | Delete
?>
[213] Fix | Delete
</p>
[214] Fix | Delete
[215] Fix | Delete
<?php
[216] Fix | Delete
if ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpos( $permalink_structure, '/blog/' ) ) {
[217] Fix | Delete
$permalink_structure = preg_replace( '|^/?blog|', '', $permalink_structure );
[218] Fix | Delete
$category_base = preg_replace( '|^/?blog|', '', $category_base );
[219] Fix | Delete
$tag_base = preg_replace( '|^/?blog|', '', $tag_base );
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
$structures = array(
[223] Fix | Delete
0 => '',
[224] Fix | Delete
1 => $prefix . '/%year%/%monthnum%/%day%/%postname%/',
[225] Fix | Delete
2 => $prefix . '/%year%/%monthnum%/%postname%/',
[226] Fix | Delete
3 => $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%',
[227] Fix | Delete
4 => $prefix . '/%postname%/',
[228] Fix | Delete
);
[229] Fix | Delete
?>
[230] Fix | Delete
<h2 class="title"><?php _e( 'Common Settings' ); ?></h2>
[231] Fix | Delete
<table class="form-table permalink-structure">
[232] Fix | Delete
<tr>
[233] Fix | Delete
<th scope="row"><label><input name="selection" type="radio" value="" <?php checked( '', $permalink_structure ); ?> /> <?php _e( 'Plain' ); ?></label></th>
[234] Fix | Delete
<td><code><?php echo get_option( 'home' ); ?>/?p=123</code></td>
[235] Fix | Delete
</tr>
[236] Fix | Delete
<tr>
[237] Fix | Delete
<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[1] ); ?>" <?php checked( $structures[1], $permalink_structure ); ?> /> <?php _e( 'Day and name' ); ?></label></th>
[238] Fix | Delete
<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . gmdate( 'd' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
[239] Fix | Delete
</tr>
[240] Fix | Delete
<tr>
[241] Fix | Delete
<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[2] ); ?>" <?php checked( $structures[2], $permalink_structure ); ?> /> <?php _e( 'Month and name' ); ?></label></th>
[242] Fix | Delete
<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . gmdate( 'Y' ) . '/' . gmdate( 'm' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
[243] Fix | Delete
</tr>
[244] Fix | Delete
<tr>
[245] Fix | Delete
<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[3] ); ?>" <?php checked( $structures[3], $permalink_structure ); ?> /> <?php _e( 'Numeric' ); ?></label></th>
[246] Fix | Delete
<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/123'; ?></code></td>
[247] Fix | Delete
</tr>
[248] Fix | Delete
<tr>
[249] Fix | Delete
<th scope="row"><label><input name="selection" type="radio" value="<?php echo esc_attr( $structures[4] ); ?>" <?php checked( $structures[4], $permalink_structure ); ?> /> <?php _e( 'Post name' ); ?></label></th>
[250] Fix | Delete
<td><code><?php echo get_option( 'home' ) . $blog_prefix . $prefix . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/'; ?></code></td>
[251] Fix | Delete
</tr>
[252] Fix | Delete
<tr>
[253] Fix | Delete
<th scope="row">
[254] Fix | Delete
<label><input name="selection" id="custom_selection" type="radio" value="custom" <?php checked( ! in_array( $permalink_structure, $structures, true ) ); ?> />
[255] Fix | Delete
<?php _e( 'Custom Structure' ); ?>
[256] Fix | Delete
</label>
[257] Fix | Delete
</th>
[258] Fix | Delete
<td>
[259] Fix | Delete
<code><?php echo get_option( 'home' ) . $blog_prefix; ?></code>
[260] Fix | Delete
<input name="permalink_structure" id="permalink_structure" type="text" value="<?php echo esc_attr( $permalink_structure ); ?>" class="regular-text code" />
[261] Fix | Delete
<div class="available-structure-tags hide-if-no-js">
[262] Fix | Delete
<div id="custom_selection_updated" aria-live="assertive" class="screen-reader-text"></div>
[263] Fix | Delete
<?php
[264] Fix | Delete
$available_tags = array(
[265] Fix | Delete
/* translators: %s: Permalink structure tag. */
[266] Fix | Delete
'year' => __( '%s (The year of the post, four digits, for example 2004.)' ),
[267] Fix | Delete
/* translators: %s: Permalink structure tag. */
[268] Fix | Delete
'monthnum' => __( '%s (Month of the year, for example 05.)' ),
[269] Fix | Delete
/* translators: %s: Permalink structure tag. */
[270] Fix | Delete
'day' => __( '%s (Day of the month, for example 28.)' ),
[271] Fix | Delete
/* translators: %s: Permalink structure tag. */
[272] Fix | Delete
'hour' => __( '%s (Hour of the day, for example 15.)' ),
[273] Fix | Delete
/* translators: %s: Permalink structure tag. */
[274] Fix | Delete
'minute' => __( '%s (Minute of the hour, for example 43.)' ),
[275] Fix | Delete
/* translators: %s: Permalink structure tag. */
[276] Fix | Delete
'second' => __( '%s (Second of the minute, for example 33.)' ),
[277] Fix | Delete
/* translators: %s: Permalink structure tag. */
[278] Fix | Delete
'post_id' => __( '%s (The unique ID of the post, for example 423.)' ),
[279] Fix | Delete
/* translators: %s: Permalink structure tag. */
[280] Fix | Delete
'postname' => __( '%s (The sanitized post title (slug).)' ),
[281] Fix | Delete
/* translators: %s: Permalink structure tag. */
[282] Fix | Delete
'category' => __( '%s (Category slug. Nested sub-categories appear as nested directories in the URL.)' ),
[283] Fix | Delete
/* translators: %s: Permalink structure tag. */
[284] Fix | Delete
'author' => __( '%s (A sanitized version of the author name.)' ),
[285] Fix | Delete
);
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* Filters the list of available permalink structure tags on the Permalinks settings page.
[289] Fix | Delete
*
[290] Fix | Delete
* @since 4.9.0
[291] Fix | Delete
*
[292] Fix | Delete
* @param string[] $available_tags An array of key => value pairs of available permalink structure tags.
[293] Fix | Delete
*/
[294] Fix | Delete
$available_tags = apply_filters( 'available_permalink_structure_tags', $available_tags );
[295] Fix | Delete
[296] Fix | Delete
/* translators: %s: Permalink structure tag. */
[297] Fix | Delete
$structure_tag_added = __( '%s added to permalink structure' );
[298] Fix | Delete
[299] Fix | Delete
/* translators: %s: Permalink structure tag. */
[300] Fix | Delete
$structure_tag_already_used = __( '%s (already used in permalink structure)' );
[301] Fix | Delete
[302] Fix | Delete
if ( ! empty( $available_tags ) ) :
[303] Fix | Delete
?>
[304] Fix | Delete
<p><?php _e( 'Available tags:' ); ?></p>
[305] Fix | Delete
<ul role="list">
[306] Fix | Delete
<?php
[307] Fix | Delete
foreach ( $available_tags as $tag => $explanation ) {
[308] Fix | Delete
?>
[309] Fix | Delete
<li>
[310] Fix | Delete
<button type="button"
[311] Fix | Delete
class="button button-secondary"
[312] Fix | Delete
aria-label="<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>"
[313] Fix | Delete
data-added="<?php echo esc_attr( sprintf( $structure_tag_added, $tag ) ); ?>"
[314] Fix | Delete
data-used="<?php echo esc_attr( sprintf( $structure_tag_already_used, $tag ) ); ?>">
[315] Fix | Delete
<?php echo '%' . $tag . '%'; ?>
[316] Fix | Delete
</button>
[317] Fix | Delete
</li>
[318] Fix | Delete
<?php
[319] Fix | Delete
}
[320] Fix | Delete
?>
[321] Fix | Delete
</ul>
[322] Fix | Delete
<?php endif; ?>
[323] Fix | Delete
</div>
[324] Fix | Delete
</td>
[325] Fix | Delete
</tr>
[326] Fix | Delete
</table>
[327] Fix | Delete
[328] Fix | Delete
<h2 class="title"><?php _e( 'Optional' ); ?></h2>
[329] Fix | Delete
<p>
[330] Fix | Delete
<?php
[331] Fix | Delete
/* translators: %s: Placeholder that must come at the start of the URL. */
[332] Fix | Delete
printf( __( 'If you like, you may enter custom structures for your category and tag URLs here. For example, using <code>topics</code> as your category base would make your category links like <code>%s/topics/uncategorized/</code>. If you leave these blank the defaults will be used.' ), get_option( 'home' ) . $blog_prefix . $prefix );
[333] Fix | Delete
?>
[334] Fix | Delete
</p>
[335] Fix | Delete
[336] Fix | Delete
<table class="form-table" role="presentation">
[337] Fix | Delete
<tr>
[338] Fix | Delete
<th><label for="category_base"><?php /* translators: Prefix for category permalinks. */ _e( 'Category base' ); ?></label></th>
[339] Fix | Delete
<td><?php echo $blog_prefix; ?> <input name="category_base" id="category_base" type="text" value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code" /></td>
[340] Fix | Delete
</tr>
[341] Fix | Delete
<tr>
[342] Fix | Delete
<th><label for="tag_base"><?php _e( 'Tag base' ); ?></label></th>
[343] Fix | Delete
<td><?php echo $blog_prefix; ?> <input name="tag_base" id="tag_base" type="text" value="<?php echo esc_attr( $tag_base ); ?>" class="regular-text code" /></td>
[344] Fix | Delete
</tr>
[345] Fix | Delete
<?php do_settings_fields( 'permalink', 'optional' ); ?>
[346] Fix | Delete
</table>
[347] Fix | Delete
[348] Fix | Delete
<?php do_settings_sections( 'permalink' ); ?>
[349] Fix | Delete
[350] Fix | Delete
<?php submit_button(); ?>
[351] Fix | Delete
</form>
[352] Fix | Delete
<?php if ( ! is_multisite() ) { ?>
[353] Fix | Delete
<?php
[354] Fix | Delete
if ( $iis7_permalinks ) :
[355] Fix | Delete
if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
[356] Fix | Delete
if ( file_exists( $home_path . 'web.config' ) ) :
[357] Fix | Delete
?>
[358] Fix | Delete
<p>
[359] Fix | Delete
<?php
[360] Fix | Delete
printf(
[361] Fix | Delete
/* translators: 1: web.config, 2: Documentation URL, 3: CTRL + a, 4: Element code. */
[362] Fix | Delete
__( '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.' ),
[363] Fix | Delete
'<code>web.config</code>',
[364] Fix | Delete
__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
[365] Fix | Delete
'<kbd>CTRL + a</kbd>',
[366] Fix | Delete
'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
[367] Fix | Delete
);
[368] Fix | Delete
?>
[369] Fix | Delete
</p>
[370] Fix | Delete
<form action="options-permalink.php" method="post">
[371] Fix | Delete
<?php wp_nonce_field( 'update-permalink' ); ?>
[372] Fix | Delete
<p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
[373] Fix | Delete
</form>
[374] Fix | Delete
<p>
[375] Fix | Delete
<?php
[376] Fix | Delete
printf(
[377] Fix | Delete
/* translators: %s: web.config */
[378] Fix | Delete
__( '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.' ),
[379] Fix | Delete
'<code>web.config</code>'
[380] Fix | Delete
);
[381] Fix | Delete
?>
[382] Fix | Delete
</p>
[383] Fix | Delete
<?php else : ?>
[384] Fix | Delete
<p>
[385] Fix | Delete
<?php
[386] Fix | Delete
printf(
[387] Fix | Delete
/* translators: 1: Documentation URL, 2: web.config, 3: CTRL + a */
[388] Fix | Delete
__( '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.' ),
[389] Fix | Delete
__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
[390] Fix | Delete
'<code>web.config</code>',
[391] Fix | Delete
'<kbd>CTRL + a</kbd>'
[392] Fix | Delete
);
[393] Fix | Delete
?>
[394] Fix | Delete
</p>
[395] Fix | Delete
<form action="options-permalink.php" method="post">
[396] Fix | Delete
<?php wp_nonce_field( 'update-permalink' ); ?>
[397] Fix | Delete
<p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules( true ) ); ?></textarea></p>
[398] Fix | Delete
</form>
[399] Fix | Delete
<p>
[400] Fix | Delete
<?php
[401] Fix | Delete
printf(
[402] Fix | Delete
/* translators: %s: web.config */
[403] Fix | Delete
__( '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.' ),
[404] Fix | Delete
'<code>web.config</code>'
[405] Fix | Delete
);
[406] Fix | Delete
?>
[407] Fix | Delete
</p>
[408] Fix | Delete
<?php endif; ?>
[409] Fix | Delete
<?php endif; ?>
[410] Fix | Delete
<?php elseif ( $is_nginx ) : ?>
[411] Fix | Delete
<p><?php _e( '<a href="https://wordpress.org/support/article/nginx/">Documentation on Nginx configuration</a>.' ); ?></p>
[412] Fix | Delete
<?php
[413] Fix | Delete
else :
[414] Fix | Delete
if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $htaccess_update_required ) :
[415] Fix | Delete
?>
[416] Fix | Delete
<p>
[417] Fix | Delete
<?php
[418] Fix | Delete
printf(
[419] Fix | Delete
/* translators: 1: .htaccess, 2: Documentation URL, 3: CTRL + a */
[420] Fix | Delete
__( '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.' ),
[421] Fix | Delete
'<code>.htaccess</code>',
[422] Fix | Delete
__( 'https://wordpress.org/support/article/changing-file-permissions/' ),
[423] Fix | Delete
'<kbd>CTRL + a</kbd>'
[424] Fix | Delete
);
[425] Fix | Delete
?>
[426] Fix | Delete
</p>
[427] Fix | Delete
<form action="options-permalink.php" method="post">
[428] Fix | Delete
<?php wp_nonce_field( 'update-permalink' ); ?>
[429] Fix | Delete
<p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
[430] Fix | Delete
</form>
[431] Fix | Delete
<?php endif; ?>
[432] Fix | Delete
<?php endif; ?>
[433] Fix | Delete
<?php } // End if ! is_multisite(). ?>
[434] Fix | Delete
[435] Fix | Delete
</div>
[436] Fix | Delete
[437] Fix | Delete
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
[438] Fix | Delete
[439] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function