diff --git a/src/wp-admin/css/forms.css b/src/wp-admin/css/forms.css index 6349c1e86453e..4da1dbab7d704 100644 --- a/src/wp-admin/css/forms.css +++ b/src/wp-admin/css/forms.css @@ -1069,9 +1069,26 @@ table.form-table td .updated p { vertical-align: middle; } -.form-table.permalink-structure .available-structure-tags li { - float: left; - margin-right: 5px; +.form-table.permalink-structure .available-structure-tags fieldset { + display: flex; + flex-wrap: wrap; +} + +.form-table.permalink-structure .available-structure-tags legend { + margin-bottom: 8px; +} + +.form-table.permalink-structure .available-structure-tags button { + margin-right: 8px; + margin-bottom: 8px; +} + +.form-table.permalink-structure .structure-selection label { + margin-bottom: 8px!important; +} + +.form-table.permalink-structure .structure-selection .description { + margin-left: 24px; } /*------------------------------------------------------------------------------ diff --git a/src/wp-admin/options-permalink.php b/src/wp-admin/options-permalink.php index dcea25096031a..06c0eec56fe44 100644 --- a/src/wp-admin/options-permalink.php +++ b/src/wp-admin/options-permalink.php @@ -238,100 +238,101 @@ ?>

- - - - - - - - - - - - - - - - - - - - - - - + + + - + $available_tags = array( + /* translators: %s: Permalink structure tag. */ + 'year' => __( '%s (The year of the post, four digits, for example 2004.)' ), + /* translators: %s: Permalink structure tag. */ + 'monthnum' => __( '%s (Month of the year, for example 05.)' ), + /* translators: %s: Permalink structure tag. */ + 'day' => __( '%s (Day of the month, for example 28.)' ), + /* translators: %s: Permalink structure tag. */ + 'hour' => __( '%s (Hour of the day, for example 15.)' ), + /* translators: %s: Permalink structure tag. */ + 'minute' => __( '%s (Minute of the hour, for example 43.)' ), + /* translators: %s: Permalink structure tag. */ + 'second' => __( '%s (Second of the minute, for example 33.)' ), + /* translators: %s: Permalink structure tag. */ + 'post_id' => __( '%s (The unique ID of the post, for example 423.)' ), + /* translators: %s: Permalink structure tag. */ + 'postname' => __( '%s (The sanitized post title (slug).)' ), + /* translators: %s: Permalink structure tag. */ + 'category' => __( '%s (Category slug. Nested sub-categories appear as nested directories in the URL.)' ), + /* translators: %s: Permalink structure tag. */ + 'author' => __( '%s (A sanitized version of the author name.)' ), + ); + + /** + * Filters the list of available permalink structure tags on the Permalinks settings page. + * + * @since 4.9.0 + * + * @param string[] $available_tags An array of key => value pairs of available permalink structure tags. + */ + $available_tags = apply_filters( 'available_permalink_structure_tags', $available_tags ); + + /* translators: %s: Permalink structure tag. */ + $structure_tag_added = __( '%s added to permalink structure' ); + + /* translators: %s: Permalink structure tag. */ + $structure_tag_already_used = __( '%s (already used in permalink structure)' ); + + if ( ! empty( $available_tags ) ) : + ?> + +
+ $explanation ) { + ?> + + +
+ + +
+ + + +