Add short name field in General Settings when Site Title is longer than 12 characters#691
Merged
westonruter merged 15 commits intodevelopfrom Feb 11, 2022
Merged
Add short name field in General Settings when Site Title is longer than 12 characters#691westonruter merged 15 commits intodevelopfrom
westonruter merged 15 commits intodevelopfrom
Conversation
Collaborator
Author
|
Still need to add tests, but otherwise this is ready for review.
|
Codecov Report
@@ Coverage Diff @@
## develop #691 +/- ##
=============================================
+ Coverage 16.75% 19.05% +2.30%
- Complexity 305 324 +19
=============================================
Files 55 55
Lines 2011 2062 +51
=============================================
+ Hits 337 393 +56
+ Misses 1674 1669 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Collaborator
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #210.
This adds a new Short Name field to the General Settings screen:
This field is required if the Site Title is longer than 12 characters:
If if the Site Title is less than or equal to 12 characters long, then the
placeholdervalue is set to match the Site Title (since it is used by default in the manifest in this case), and the field is notrequired:If the Site Title is greater than 12 characters in length, a user must supply a Short Name to save the form (and the field has a
maxlengthof 12 supplied, which is enforced by thesanitize_callback):If a site is supplying the Short Name via a plugin, like as follows (which was the only way to do so before now):
Then the Short Name field is disabled in the same way the Site URL and Home URL fields if they are defined with constants:
The Site Health test for the Short Name now includes a link to the General Settings screen to manage the field:
Other changes:
mb_strlen()forshort_namecheck.trim()on a short name before checking the length or adding to the manifest.