Closed jaswrks closed 9 years ago
:+1: Love this idea!
Endpoint: /wp-kb-articles/api/tax-query
Query args:
q
Search query (optional).type
One of tag
or category
; defaults to tag
.expand
Default is true
. Details to come later.Example response:
{
"results": [
{
"id": "16",
"name": "[s2File /] Shortcode",
"slug": "s2file",
"url": "http://s2member.com/kb/kb-tag/s2file/",
"description": "",
"parent_id": "0",
"count": "4"
},
{
"id": "78",
"name": "[s2Get /] Shortcode",
"slug": "s2get",
"url": "http://s2member.com/kb/kb-tag/s2get/",
"description": "",
"parent_id": "0",
"count": "1"
},
{
"id": "80",
"name": "[s2If /] Shortcode",
"slug": "s2if",
"url": "http://s2member.com/kb/kb-tag/s2if/",
"description": "",
"parent_id": "0",
"count": "2"
},
{
"id": "37",
"name": "[s2Member-List /] Shortcode",
"slug": "s2member-list",
"url": "http://s2member.com/kb/kb-tag/s2member-list/",
"description": "",
"parent_id": "0",
"count": "5"
},
{
"id": "77",
"name": "[s2MOP /] Shortcode",
"slug": "s2mop",
"url": "http://s2member.com/kb/kb-tag/s2mop/",
"description": "",
"parent_id": "0",
"count": "3"
},
{
"id": "17",
"name": "[s2Stream /] Shortcode",
"slug": "s2stream",
"url": "http://s2member.com/kb/kb-tag/s2stream/",
"description": "",
"parent_id": "0",
"count": "8"
},
{
"id": "18",
"name": "Shortcodes",
"slug": "shortcodes",
"url": "http://s2member.com/kb/kb-tag/shortcodes/",
"description": "",
"parent_id": "0",
"count": "20"
}
],
"args": {
"type": "tag",
"q": "shortcode",
"expand": true
}
}
@jaswsinc Awesome! I've started a KB Article draft to document this: https://github.com/websharks/wp-kb-articles-kb/issues/10
@raamdev writes...
I've started a KB Article draft to document this: websharks/wp-kb-articles-kb#10
Ah, thanks.
I added four new workflows here for tag-related searches: https://github.com/jaswsinc/alfred-workflows/tree/master/websharks
Type: s2ts [query]
to search for tag slug insertions.
Type: s2tl [query]
to search for tag link insertions.
Same with zcts
and zctl
.
Note that your very first search for tags will take just a moment. After this, tag searches are instantaneous autocompletions.
instantaneous autocompletions.
I did notice how amazingly fast it was--awesome!
It would be very helpful if WPKBA's API supported tag queries. In short, making it possible to search through all existing KB article tags. With that in place, we could build Alfred Workflows that search KB tags whenever we write new articles.