Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
fix links autocomplete suggestions: empty post title fallback #3575
Conversation
| @@ -215,7 +215,7 @@ class UrlInput extends Component { | ||
| onClick={ () => this.props.onChange( post.link ) } | ||
| aria-selected={ index === selectedSuggestion } | ||
| > | ||
| - { post.title.rendered } | ||
| + { post.title.rendered || `( ${ __( 'no title' ) } )` } |
youknowriad
Nov 20, 2017
Collaborator
Maybe a bit simpler like this: post.title.rendered || __( 'no title' )
vladanost
Nov 20, 2017
Contributor
Sure, I can do that. I added the brackets so they are more in line with how no title posts are displayed in other places in WP admin as @afercia noted.
youknowriad
Nov 21, 2017
Collaborator
Oh sorry for the confusion, I see what you mean now and you're right we should add the parenthesis. post.title.rendered || __( '(no title)' )
A quick search in the WP source code shows that the parenthesis are included in the translated message.
youknowriad
requested a review
from
afercia
Nov 20, 2017
vladanost
added some commits
Nov 20, 2017
codecov
bot
commented
Nov 21, 2017
•
Codecov Report
@@ Coverage Diff @@
## master #3575 +/- ##
=========================================
+ Coverage 35.15% 35.76% +0.6%
=========================================
Files 267 267
Lines 6724 6744 +20
Branches 1218 1221 +3
=========================================
+ Hits 2364 2412 +48
+ Misses 3683 3657 -26
+ Partials 677 675 -2
Continue to review full report at Codecov.
|
vladanost commentedNov 20, 2017
Description
Fixes #3573
How Has This Been Tested?
Manually tested in the browser.
Types of changes
Added fallback title for post with no title