Edit File by line
/home/zeestwma/redstone.../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
// Used in the HTML title tag.
[15] Fix | Delete
$title = __( 'Permalink Settings' );
[16] Fix | Delete
$parent_file = 'options-general.php';
[17] Fix | Delete
[18] Fix | Delete
get_current_screen()->add_help_tab(
[19] Fix | Delete
array(
[20] Fix | Delete
'id' => 'overview',
[21] Fix | Delete
'title' => __( 'Overview' ),
[22] 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>' .
[23] Fix | Delete
'<p>' . __( 'This screen allows you to choose your permalink structure. You can choose from common settings or create custom URL structures.' ) . '</p>' .
[24] Fix | Delete
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
[25] Fix | Delete
)
[26] Fix | Delete
);
[27] Fix | Delete
[28] Fix | Delete
get_current_screen()->add_help_tab(
[29] Fix | Delete
array(
[30] Fix | Delete
'id' => 'permalink-settings',
[31] Fix | Delete
'title' => __( 'Permalink Settings' ),
[32] 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>' .
[33] Fix | Delete
'<p>' . sprintf(
[34] Fix | Delete
/* translators: %s: Percent sign (%). */
[35] 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.' ),
[36] Fix | Delete
'<code>%</code>'
[37] Fix | Delete
) . '</p>' .
[38] Fix | Delete
'<p>' . sprintf(
[39] Fix | Delete
/* translators: 1: %category%, 2: %tag% */
[40] 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.' ),
[41] Fix | Delete
'<code>%category%</code>',
[42] Fix | Delete
'<code>%tag%</code>'
[43] Fix | Delete
) . '</p>' .
[44] Fix | Delete
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
[45] Fix | Delete
)
[46] Fix | Delete
);
[47] Fix | Delete
[48] Fix | Delete
get_current_screen()->add_help_tab(
[49] Fix | Delete
array(
[50] Fix | Delete
'id' => 'custom-structures',
[51] Fix | Delete
'title' => __( 'Custom Structures' ),
[52] 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>' .
[53] Fix | Delete
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
[54] Fix | Delete
)
[55] Fix | Delete
);
[56] Fix | Delete
[57] Fix | Delete
$help_sidebar_content = '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[58] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-permalinks-screen/">Documentation on Permalinks Settings</a>' ) . '</p>' .
[59] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/documentation/article/customize-permalinks/">Documentation on Using Permalinks</a>' ) . '</p>';
[60] Fix | Delete
[61] Fix | Delete
if ( $is_nginx ) {
[62] Fix | Delete
$help_sidebar_content .= '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/server/web-server/nginx/">Documentation on Nginx configuration</a>.' ) . '</p>';
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
$help_sidebar_content .= '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>';
[66] Fix | Delete
[67] Fix | Delete
get_current_screen()->set_help_sidebar( $help_sidebar_content );
[68] Fix | Delete
unset( $help_sidebar_content );
[69] Fix | Delete
[70] Fix | Delete
$home_path = get_home_path();
[71] Fix | Delete
$iis7_permalinks = iis7_supports_permalinks();
[72] Fix | Delete
$permalink_structure = get_option( 'permalink_structure' );
[73] Fix | Delete
[74] Fix | Delete
$index_php_prefix = '';
[75] Fix | Delete
$blog_prefix = '';
[76] Fix | Delete
[77] Fix | Delete
if ( ! got_url_rewrite() ) {
[78] Fix | Delete
$index_php_prefix = '/index.php';
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
/*
[82] Fix | Delete
* In a subdirectory configuration of multisite, the `/blog` prefix is used by
[83] Fix | Delete
* default on the main site to avoid collisions with other sites created on that
[84] Fix | Delete
* network. If the `permalink_structure` option has been changed to remove this
[85] Fix | Delete
* base prefix, WordPress core can no longer account for the possible collision.
[86] Fix | Delete
*/
[87] Fix | Delete
if ( is_multisite() && ! is_subdomain_install() && is_main_site()
[88] Fix | Delete
&& str_starts_with( $permalink_structure, '/blog/' )
[89] Fix | Delete
) {
[90] Fix | Delete
$blog_prefix = '/blog';
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
$category_base = get_option( 'category_base' );
[94] Fix | Delete
$tag_base = get_option( 'tag_base' );
[95] Fix | Delete
[96] Fix | Delete
$structure_updated = false;
[97] Fix | Delete
$htaccess_update_required = false;
[98] Fix | Delete
[99] Fix | Delete
if ( isset( $_POST['permalink_structure'] ) || isset( $_POST['category_base'] ) ) {
[100] Fix | Delete
check_admin_referer( 'update-permalink' );
[101] Fix | Delete
[102] Fix | Delete
if ( isset( $_POST['permalink_structure'] ) ) {
[103] Fix | Delete
if ( isset( $_POST['selection'] ) && 'custom' !== $_POST['selection'] ) {
[104] Fix | Delete
$permalink_structure = $_POST['selection'];
[105] Fix | Delete
} else {
[106] Fix | Delete
$permalink_structure = $_POST['permalink_structure'];
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
if ( ! empty( $permalink_structure ) ) {
[110] Fix | Delete
$permalink_structure = preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $permalink_structure ) );
[111] Fix | Delete
[112] Fix | Delete
if ( $index_php_prefix && $blog_prefix ) {
[113] Fix | Delete
$permalink_structure = $index_php_prefix . preg_replace( '#^/?index\.php#', '', $permalink_structure );
[114] Fix | Delete
} else {
[115] Fix | Delete
$permalink_structure = $blog_prefix . $permalink_structure;
[116] Fix | Delete
}
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
$permalink_structure = sanitize_option( 'permalink_structure', $permalink_structure );
[120] Fix | Delete
[121] Fix | Delete
$wp_rewrite->set_permalink_structure( $permalink_structure );
[122] Fix | Delete
[123] Fix | Delete
$structure_updated = true;
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
if ( isset( $_POST['category_base'] ) ) {
[127] Fix | Delete
$category_base = $_POST['category_base'];
[128] Fix | Delete
[129] Fix | Delete
if ( ! empty( $category_base ) ) {
[130] Fix | Delete
$category_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $category_base ) );
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
$wp_rewrite->set_category_base( $category_base );
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
if ( isset( $_POST['tag_base'] ) ) {
[137] Fix | Delete
$tag_base = $_POST['tag_base'];
[138] Fix | Delete
[139] Fix | Delete
if ( ! empty( $tag_base ) ) {
[140] Fix | Delete
$tag_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $tag_base ) );
[141] Fix | Delete
}
[142] Fix | Delete
[143] Fix | Delete
$wp_rewrite->set_tag_base( $tag_base );
[144] Fix | Delete
}
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
if ( $iis7_permalinks ) {
[148] Fix | Delete
if ( ( ! file_exists( $home_path . 'web.config' )
[149] Fix | Delete
&& win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' )
[150] Fix | Delete
) {
[151] Fix | Delete
$writable = true;
[152] Fix | Delete
} else {
[153] Fix | Delete
$writable = false;
[154] Fix | Delete
}
[155] Fix | Delete
} elseif ( $is_nginx || $is_caddy ) {
[156] Fix | Delete
$writable = false;
[157] Fix | Delete
} else {
[158] Fix | Delete
if ( ( ! file_exists( $home_path . '.htaccess' )
[159] Fix | Delete
&& is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' )
[160] Fix | Delete
) {
[161] Fix | Delete
$writable = true;
[162] Fix | Delete
} else {
[163] Fix | Delete
$writable = false;
[164] Fix | Delete
$existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) );
[165] Fix | Delete
$new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) );
[166] Fix | Delete
[167] Fix | Delete
$htaccess_update_required = ( $new_rules !== $existing_rules );
[168] Fix | Delete
}
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
$using_index_permalinks = $wp_rewrite->using_index_permalinks();
[172] Fix | Delete
[173] Fix | Delete
if ( $structure_updated ) {
[174] Fix | Delete
$message = __( 'Permalink structure updated.' );
[175] Fix | Delete
[176] Fix | Delete
if ( ! is_multisite() && $permalink_structure && ! $using_index_permalinks ) {
[177] Fix | Delete
if ( $iis7_permalinks ) {
[178] Fix | Delete
if ( ! $writable ) {
[179] Fix | Delete
$message = sprintf(
[180] Fix | Delete
/* translators: %s: web.config */
[181] Fix | Delete
__( 'You should update your %s file now.' ),
[182] Fix | Delete
'<code>web.config</code>'
[183] Fix | Delete
);
[184] Fix | Delete
} else {
[185] Fix | Delete
$message = sprintf(
[186] Fix | Delete
/* translators: %s: web.config */
[187] Fix | Delete
__( 'Permalink structure updated. Remove write access on %s file now!' ),
[188] Fix | Delete
'<code>web.config</code>'
[189] Fix | Delete
);
[190] Fix | Delete
}
[191] Fix | Delete
} elseif ( ! $is_nginx && ! $is_caddy && $htaccess_update_required && ! $writable ) {
[192] Fix | Delete
$message = sprintf(
[193] Fix | Delete
/* translators: %s: .htaccess */
[194] Fix | Delete
__( 'You should update your %s file now.' ),
[195] Fix | Delete
'<code>.htaccess</code>'
[196] Fix | Delete
);
[197] Fix | Delete
}
[198] Fix | Delete
}
[199] Fix | Delete
[200] Fix | Delete
if ( ! get_settings_errors() ) {
[201] Fix | Delete
add_settings_error( 'general', 'settings_updated', $message, 'success' );
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
set_transient( 'settings_errors', get_settings_errors(), 30 ); // 30 seconds.
[205] Fix | Delete
[206] Fix | Delete
wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) );
[207] Fix | Delete
exit;
[208] Fix | Delete
}
[209] Fix | Delete
[210] Fix | Delete
flush_rewrite_rules();
[211] Fix | Delete
[212] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[213] Fix | Delete
?>
[214] Fix | Delete
<div class="wrap">
[215] Fix | Delete
<h1><?php echo esc_html( $title ); ?></h1>
[216] Fix | Delete
[217] Fix | Delete
<form name="form" action="options-permalink.php" method="post">
[218] Fix | Delete
<?php wp_nonce_field( 'update-permalink' ); ?>
[219] Fix | Delete
[220] Fix | Delete
<p>
[221] Fix | Delete
<?php
[222] Fix | Delete
printf(
[223] Fix | Delete
/* translators: %s: Documentation URL. */
[224] 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.' ),
[225] Fix | Delete
__( 'https://wordpress.org/documentation/article/customize-permalinks/' )
[226] Fix | Delete
);
[227] Fix | Delete
?>
[228] Fix | Delete
</p>
[229] Fix | Delete
[230] Fix | Delete
<?php
[231] Fix | Delete
if ( is_multisite() && ! is_subdomain_install() && is_main_site()
[232] Fix | Delete
&& str_starts_with( $permalink_structure, '/blog/' )
[233] Fix | Delete
) {
[234] Fix | Delete
$permalink_structure = preg_replace( '|^/?blog|', '', $permalink_structure );
[235] Fix | Delete
$category_base = preg_replace( '|^/?blog|', '', $category_base );
[236] Fix | Delete
$tag_base = preg_replace( '|^/?blog|', '', $tag_base );
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
$url_base = home_url( $blog_prefix . $index_php_prefix );
[240] Fix | Delete
[241] Fix | Delete
$default_structures = array(
[242] Fix | Delete
array(
[243] Fix | Delete
'id' => 'plain',
[244] Fix | Delete
'label' => __( 'Plain' ),
[245] Fix | Delete
'value' => '',
[246] Fix | Delete
'example' => home_url( '/?p=123' ),
[247] Fix | Delete
),
[248] Fix | Delete
array(
[249] Fix | Delete
'id' => 'day-name',
[250] Fix | Delete
'label' => __( 'Day and name' ),
[251] Fix | Delete
'value' => $index_php_prefix . '/%year%/%monthnum%/%day%/%postname%/',
[252] Fix | Delete
'example' => $url_base . '/' . gmdate( 'Y/m/d' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/',
[253] Fix | Delete
),
[254] Fix | Delete
array(
[255] Fix | Delete
'id' => 'month-name',
[256] Fix | Delete
'label' => __( 'Month and name' ),
[257] Fix | Delete
'value' => $index_php_prefix . '/%year%/%monthnum%/%postname%/',
[258] Fix | Delete
'example' => $url_base . '/' . gmdate( 'Y/m' ) . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/',
[259] Fix | Delete
),
[260] Fix | Delete
array(
[261] Fix | Delete
'id' => 'numeric',
[262] Fix | Delete
'label' => __( 'Numeric' ),
[263] Fix | Delete
'value' => $index_php_prefix . '/' . _x( 'archives', 'sample permalink base' ) . '/%post_id%',
[264] Fix | Delete
'example' => $url_base . '/' . _x( 'archives', 'sample permalink base' ) . '/123',
[265] Fix | Delete
),
[266] Fix | Delete
array(
[267] Fix | Delete
'id' => 'post-name',
[268] Fix | Delete
'label' => __( 'Post name' ),
[269] Fix | Delete
'value' => $index_php_prefix . '/%postname%/',
[270] Fix | Delete
'example' => $url_base . '/' . _x( 'sample-post', 'sample permalink structure' ) . '/',
[271] Fix | Delete
),
[272] Fix | Delete
);
[273] Fix | Delete
[274] Fix | Delete
$default_structure_values = wp_list_pluck( $default_structures, 'value' );
[275] Fix | Delete
[276] Fix | Delete
$available_tags = array(
[277] Fix | Delete
/* translators: %s: Permalink structure tag. */
[278] Fix | Delete
'year' => __( '%s (The year of the post, four digits, for example 2004.)' ),
[279] Fix | Delete
/* translators: %s: Permalink structure tag. */
[280] Fix | Delete
'monthnum' => __( '%s (Month of the year, for example 05.)' ),
[281] Fix | Delete
/* translators: %s: Permalink structure tag. */
[282] Fix | Delete
'day' => __( '%s (Day of the month, for example 28.)' ),
[283] Fix | Delete
/* translators: %s: Permalink structure tag. */
[284] Fix | Delete
'hour' => __( '%s (Hour of the day, for example 15.)' ),
[285] Fix | Delete
/* translators: %s: Permalink structure tag. */
[286] Fix | Delete
'minute' => __( '%s (Minute of the hour, for example 43.)' ),
[287] Fix | Delete
/* translators: %s: Permalink structure tag. */
[288] Fix | Delete
'second' => __( '%s (Second of the minute, for example 33.)' ),
[289] Fix | Delete
/* translators: %s: Permalink structure tag. */
[290] Fix | Delete
'post_id' => __( '%s (The unique ID of the post, for example 423.)' ),
[291] Fix | Delete
/* translators: %s: Permalink structure tag. */
[292] Fix | Delete
'postname' => __( '%s (The sanitized post title (slug).)' ),
[293] Fix | Delete
/* translators: %s: Permalink structure tag. */
[294] Fix | Delete
'category' => __( '%s (Category slug. Nested sub-categories appear as nested directories in the URL.)' ),
[295] Fix | Delete
/* translators: %s: Permalink structure tag. */
[296] Fix | Delete
'author' => __( '%s (A sanitized version of the author name.)' ),
[297] Fix | Delete
);
[298] Fix | Delete
[299] Fix | Delete
/**
[300] Fix | Delete
* Filters the list of available permalink structure tags on the Permalinks settings page.
[301] Fix | Delete
*
[302] Fix | Delete
* @since 4.9.0
[303] Fix | Delete
*
[304] Fix | Delete
* @param string[] $available_tags An array of key => value pairs of available permalink structure tags.
[305] Fix | Delete
*/
[306] Fix | Delete
$available_tags = apply_filters( 'available_permalink_structure_tags', $available_tags );
[307] Fix | Delete
[308] Fix | Delete
/* translators: %s: Permalink structure tag. */
[309] Fix | Delete
$tag_added = __( '%s added to permalink structure' );
[310] Fix | Delete
/* translators: %s: Permalink structure tag. */
[311] Fix | Delete
$tag_removed = __( '%s removed from permalink structure' );
[312] Fix | Delete
/* translators: %s: Permalink structure tag. */
[313] Fix | Delete
$tag_already_used = __( '%s (already used in permalink structure)' );
[314] Fix | Delete
?>
[315] Fix | Delete
<h2 class="title"><?php _e( 'Common Settings' ); ?></h2>
[316] Fix | Delete
<p>
[317] Fix | Delete
<?php
[318] Fix | Delete
printf(
[319] Fix | Delete
/* translators: %s: %postname% */
[320] Fix | Delete
__( 'Select the permalink structure for your website. Including the %s tag makes links easy to understand, and can help your posts rank higher in search engines.' ),
[321] Fix | Delete
'<code>%postname%</code>'
[322] Fix | Delete
);
[323] Fix | Delete
?>
[324] Fix | Delete
</p>
[325] Fix | Delete
<table class="form-table permalink-structure" role="presentation">
[326] Fix | Delete
<tbody>
[327] Fix | Delete
<?php $permalink_structure_title = __( 'Permalink structure' ); ?>
[328] Fix | Delete
<tr>
[329] Fix | Delete
<th scope="row"><?php echo $permalink_structure_title; ?></th>
[330] Fix | Delete
<td>
[331] Fix | Delete
<fieldset class="structure-selection">
[332] Fix | Delete
<legend class="screen-reader-text"><?php echo $permalink_structure_title; ?></legend>
[333] Fix | Delete
<?php foreach ( $default_structures as $input ) : ?>
[334] Fix | Delete
<div class="row">
[335] Fix | Delete
<input id="permalink-input-<?php echo esc_attr( $input['id'] ); ?>"
[336] Fix | Delete
name="selection" aria-describedby="permalink-<?php echo esc_attr( $input['id'] ); ?>"
[337] Fix | Delete
type="radio" value="<?php echo esc_attr( $input['value'] ); ?>"
[338] Fix | Delete
<?php checked( $input['value'], $permalink_structure ); ?>
[339] Fix | Delete
/>
[340] Fix | Delete
<div>
[341] Fix | Delete
<label for="permalink-input-<?php echo esc_attr( $input['id'] ); ?>">
[342] Fix | Delete
<?php echo esc_html( $input['label'] ); ?>
[343] Fix | Delete
</label>
[344] Fix | Delete
<p>
[345] Fix | Delete
<code id="permalink-<?php echo esc_attr( $input['id'] ); ?>">
[346] Fix | Delete
<?php echo esc_html( $input['example'] ); ?>
[347] Fix | Delete
</code>
[348] Fix | Delete
</p>
[349] Fix | Delete
</div>
[350] Fix | Delete
</div><!-- .row -->
[351] Fix | Delete
<?php endforeach; ?>
[352] Fix | Delete
[353] Fix | Delete
<div class="row">
[354] Fix | Delete
<input id="custom_selection"
[355] Fix | Delete
name="selection" type="radio" value="custom"
[356] Fix | Delete
<?php checked( ! in_array( $permalink_structure, $default_structure_values, true ) ); ?>
[357] Fix | Delete
/>
[358] Fix | Delete
<div>
[359] Fix | Delete
<label for="custom_selection"><?php _e( 'Custom Structure' ); ?></label>
[360] Fix | Delete
<p>
[361] Fix | Delete
<label for="permalink_structure" class="screen-reader-text">
[362] Fix | Delete
<?php
[363] Fix | Delete
/* translators: Hidden accessibility text. */
[364] Fix | Delete
_e( 'Customize permalink structure by selecting available tags' );
[365] Fix | Delete
?>
[366] Fix | Delete
</label>
[367] Fix | Delete
<span class="code">
[368] Fix | Delete
<code id="permalink-custom"><?php echo esc_url( $url_base ); ?></code>
[369] Fix | Delete
<input name="permalink_structure" id="permalink_structure"
[370] Fix | Delete
type="text" value="<?php echo esc_attr( $permalink_structure ); ?>"
[371] Fix | Delete
aria-describedby="permalink-custom" class="regular-text code"
[372] Fix | Delete
/>
[373] Fix | Delete
</span>
[374] Fix | Delete
</p>
[375] Fix | Delete
[376] Fix | Delete
<div class="available-structure-tags hide-if-no-js">
[377] Fix | Delete
<div id="custom_selection_updated" aria-live="assertive" class="screen-reader-text"></div>
[378] Fix | Delete
<?php if ( ! empty( $available_tags ) ) : ?>
[379] Fix | Delete
<fieldset>
[380] Fix | Delete
<legend><?php _e( 'Available tags:' ); ?></legend>
[381] Fix | Delete
<ul role="list">
[382] Fix | Delete
<?php foreach ( $available_tags as $tag => $explanation ) : ?>
[383] Fix | Delete
<li>
[384] Fix | Delete
<button type="button"
[385] Fix | Delete
class="button button-secondary"
[386] Fix | Delete
aria-label="<?php echo esc_attr( sprintf( $explanation, $tag ) ); ?>"
[387] Fix | Delete
data-added="<?php echo esc_attr( sprintf( $tag_added, $tag ) ); ?>"
[388] Fix | Delete
data-removed="<?php echo esc_attr( sprintf( $tag_removed, $tag ) ); ?>"
[389] Fix | Delete
data-used="<?php echo esc_attr( sprintf( $tag_already_used, $tag ) ); ?>">
[390] Fix | Delete
<?php echo '%' . esc_html( $tag ) . '%'; ?>
[391] Fix | Delete
</button>
[392] Fix | Delete
</li>
[393] Fix | Delete
<?php endforeach; ?>
[394] Fix | Delete
</ul>
[395] Fix | Delete
</fieldset>
[396] Fix | Delete
<?php endif; ?>
[397] Fix | Delete
</div><!-- .available-structure-tags -->
[398] Fix | Delete
</div>
[399] Fix | Delete
</div><!-- .row -->
[400] Fix | Delete
</fieldset><!-- .structure-selection -->
[401] Fix | Delete
</td>
[402] Fix | Delete
</tr>
[403] Fix | Delete
</tbody>
[404] Fix | Delete
</table>
[405] Fix | Delete
[406] Fix | Delete
<h2 class="title"><?php _e( 'Optional' ); ?></h2>
[407] Fix | Delete
<p>
[408] Fix | Delete
<?php
[409] Fix | Delete
printf(
[410] Fix | Delete
/* translators: %s: Placeholder that must come at the start of the URL. */
[411] Fix | Delete
__( '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.' ),
[412] Fix | Delete
$url_base
[413] Fix | Delete
);
[414] Fix | Delete
?>
[415] Fix | Delete
</p>
[416] Fix | Delete
[417] Fix | Delete
<table class="form-table" role="presentation">
[418] Fix | Delete
<tr>
[419] Fix | Delete
<th>
[420] Fix | Delete
<label for="category_base">
[421] Fix | Delete
<?php /* translators: Prefix for category permalinks. */ _e( 'Category base' ); ?>
[422] Fix | Delete
</label>
[423] Fix | Delete
</th>
[424] Fix | Delete
<td>
[425] Fix | Delete
<?php echo $blog_prefix; ?>
[426] Fix | Delete
<input name="category_base" id="category_base" type="text"
[427] Fix | Delete
value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code"
[428] Fix | Delete
/>
[429] Fix | Delete
</td>
[430] Fix | Delete
</tr>
[431] Fix | Delete
<tr>
[432] Fix | Delete
<th>
[433] Fix | Delete
<label for="tag_base"><?php _e( 'Tag base' ); ?></label>
[434] Fix | Delete
</th>
[435] Fix | Delete
<td>
[436] Fix | Delete
<?php echo $blog_prefix; ?>
[437] Fix | Delete
<input name="tag_base" id="tag_base" type="text"
[438] Fix | Delete
value="<?php echo esc_attr( $tag_base ); ?>" class="regular-text code"
[439] Fix | Delete
/>
[440] Fix | Delete
</td>
[441] Fix | Delete
</tr>
[442] Fix | Delete
<?php do_settings_fields( 'permalink', 'optional' ); ?>
[443] Fix | Delete
</table>
[444] Fix | Delete
[445] Fix | Delete
<?php do_settings_sections( 'permalink' ); ?>
[446] Fix | Delete
[447] Fix | Delete
<?php submit_button(); ?>
[448] Fix | Delete
</form>
[449] Fix | Delete
[450] Fix | Delete
<?php if ( ! is_multisite() ) : ?>
[451] Fix | Delete
<?php
[452] Fix | Delete
if ( $iis7_permalinks ) :
[453] Fix | Delete
if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
[454] Fix | Delete
if ( file_exists( $home_path . 'web.config' ) ) :
[455] Fix | Delete
?>
[456] Fix | Delete
<p id="iis-description-a">
[457] Fix | Delete
<?php
[458] Fix | Delete
printf(
[459] Fix | Delete
/* translators: 1: web.config, 2: Documentation URL, 3: Ctrl + A, 4: ⌘ + A, 5: Element code. */
[460] Fix | Delete
__( '<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.' ),
[461] Fix | Delete
'<code>web.config</code>',
[462] Fix | Delete
__( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ),
[463] Fix | Delete
'<kbd>Ctrl + A</kbd>',
[464] Fix | Delete
'<kbd>⌘ + A</kbd>',
[465] Fix | Delete
'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
[466] Fix | Delete
);
[467] Fix | Delete
?>
[468] Fix | Delete
</p>
[469] Fix | Delete
<form action="options-permalink.php" method="post">
[470] Fix | Delete
<?php wp_nonce_field( 'update-permalink' ); ?>
[471] Fix | Delete
<p>
[472] Fix | Delete
<label for="rules"><?php _e( 'Rewrite rules:' ); ?></label><br />
[473] Fix | Delete
<textarea rows="9" class="large-text readonly"
[474] Fix | Delete
name="rules" id="rules" readonly="readonly"
[475] Fix | Delete
aria-describedby="iis-description-a"
[476] Fix | Delete
><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea>
[477] Fix | Delete
</p>
[478] Fix | Delete
</form>
[479] Fix | Delete
<p>
[480] Fix | Delete
<?php
[481] Fix | Delete
printf(
[482] Fix | Delete
/* translators: %s: web.config */
[483] Fix | Delete
__( '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.' ),
[484] Fix | Delete
'<code>web.config</code>'
[485] Fix | Delete
);
[486] Fix | Delete
?>
[487] Fix | Delete
</p>
[488] Fix | Delete
<?php else : ?>
[489] Fix | Delete
<p id="iis-description-b">
[490] Fix | Delete
<?php
[491] Fix | Delete
printf(
[492] Fix | Delete
/* translators: 1: Documentation URL, 2: web.config, 3: Ctrl + A, 4: ⌘ + A */
[493] Fix | Delete
__( '<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.' ),
[494] Fix | Delete
__( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ),
[495] Fix | Delete
'<code>web.config</code>',
[496] Fix | Delete
'<kbd>Ctrl + A</kbd>',
[497] Fix | Delete
'<kbd>⌘ + A</kbd>'
[498] Fix | Delete
);
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function