Skip to content

Commit 858fe6e

Browse files
committed
Adding changes back, revised
The empty $blog_prefix is more common, so that condition is first
1 parent 36810cb commit 858fe6e

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/wp-admin/options-permalink.php

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,9 @@ class="button button-secondary"
395395
</tbody>
396396
</table>
397397

398-
<h2 class="title"><?php _e( 'Optional' ); ?></h2>
399-
<p>
398+
<fieldset class="permalink-structure-optional" aria-describedby="permalink-structure-optional-description">
399+
<legend><h2 class="title"><?php _e( 'Optional' ); ?></h2></legend>
400+
<p id="permalink-structure-optional-description">
400401
<?php
401402
printf(
402403
/* translators: %s: Placeholder that must come at the start of the URL. */
@@ -414,25 +415,42 @@ class="button button-secondary"
414415
</label>
415416
</th>
416417
<td>
417-
<?php echo $blog_prefix; ?>
418+
<?php if ( empty( $blog_prefix ) ) : ?>
418419
<input name="category_base" id="category_base" type="text"
419420
value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code"
420421
/>
422+
<?php else : ?>
423+
<span class="code permalink-structure-has-blog-prefix">
424+
<code><?php echo $blog_prefix; ?></code>
425+
<input name="category_base" id="category_base" type="text"
426+
value="<?php echo esc_attr( $category_base ); ?>" class="regular-text code"
427+
/>
428+
</span>
429+
<?php endif; ?>
421430
</td>
422431
</tr>
423432
<tr>
424433
<th>
425434
<label for="tag_base"><?php _e( 'Tag base' ); ?></label>
426435
</th>
427436
<td>
428-
<?php echo $blog_prefix; ?>
437+
<?php if ( empty( $blog_prefix ) ) : ?>
429438
<input name="tag_base" id="tag_base" type="text"
430439
value="<?php echo esc_attr( $tag_base ); ?>" class="regular-text code"
431440
/>
441+
<?php else : ?>
442+
<span class="code permalink-structure-has-blog-prefix">
443+
<code><?php echo $blog_prefix; ?></code>
444+
<input name="tag_base" id="tag_base" type="text"
445+
value="<?php echo esc_attr( $tag_base ); ?>" class="regular-text code"
446+
/>
447+
</span>
448+
<?php endif; ?>
432449
</td>
433450
</tr>
434451
<?php do_settings_fields( 'permalink', 'optional' ); ?>
435452
</table>
453+
</fieldset>
436454

437455
<?php do_settings_sections( 'permalink' ); ?>
438456

0 commit comments

Comments
 (0)