Block API: Adding the keywords property to enhance filtering the blocks#2115
Block API: Adding the keywords property to enhance filtering the blocks#2115youknowriad merged 2 commits intomasterfrom
Conversation
…iltering the blocks
Codecov Report
@@ Coverage Diff @@
## master #2115 +/- ##
==========================================
+ Coverage 20.33% 20.47% +0.13%
==========================================
Files 135 135
Lines 4238 4258 +20
Branches 722 727 +5
==========================================
+ Hits 862 872 +10
- Misses 2844 2853 +9
- Partials 532 533 +1
Continue to review full report at Codecov.
|
|
Love it! Works great for me. 👍 👍 |
blocks/library/verse/index.js
Outdated
There was a problem hiding this comment.
We would need to consider translation of these in the future.
There was a problem hiding this comment.
Good point. I can wrap it in i18n.__. Would that be enough?
c698a89 to
4da242a
Compare
| ); | ||
| return; | ||
| } | ||
| if ( 'keywords' in settings && settings.keywords.length > 3 ) { |
There was a problem hiding this comment.
What was the thinking behind the limit?
There was a problem hiding this comment.
Prevent plugin authors from abusing keywords (keep the inserter search "sane")
s-a-s-k-i-a
left a comment
There was a problem hiding this comment.
maximum of 3 keywords allowed; however this code allows each keyword to be unlimited characters long.
Thus this will be abused.
We can for example have keywords defined like this:
keywords: ['wordpresspaypalwoocommercefrontendyoastsaskialundwearethegreatesbestpluginwhaterverstring', 'andwhileweareatitwecanaddsomemorestorytellinghere', 'andhereandhere'],
|
@s-a-s-k-i-a yes, you can also just do |
|
Honestly I'm not sure why we bother trying to restrict keywords. Seems like unnecessary hand-slapping that determined plugin developers could always get around anyways. |
|
Agree, we should just remove the limitation. |
[UI tests] Schedule runs for full UI tests suite
This PR adds an optional
keywordsproperty taken into consideration when filtering the blocks in the inserter. As an example It's used currently to display the "verse" block if we search for "poetry"