-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add short name field in General Settings when Site Title is longer than 12 characters #691
Conversation
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.
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
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
placeholder
value 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
maxlength
of 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_name
check.trim()
on a short name before checking the length or adding to the manifest.