[wp-trac] [WordPress Trac] #28307: Ajax for Post Search

WordPress Trac noreply at wordpress.org
Sat May 31 18:48:57 UTC 2014


#28307: Ajax for Post Search
-----------------------------+-------------------------
 Reporter:  adamsilverstein  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  4.0
Component:  Administration   |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  javascript
-----------------------------+-------------------------

Comment (by azaozz):

 IMHO having autocomplete on a search field feels a bit confusing as UX. It
 overrides the purpose of that field "find posts containing [term] and
 display them on the screen".

 Autocomplete (auto-find) would work better if this was "Find a post to
 edit" field, not "search posts". It would still be harder to use as it
 misses some information about the post like status (published, draft,
 pending...), date, author, etc.

 As a technical implementation it looks good. Perhaps better to keep the
 `strlen()` instead of `mb_strlen()` and increase the minimum to 3 chars
 for "non-Latin" languages? Generally `strlen()` will return the length in
 bytes, so the search string can contain 3 ASCII chars or 1-2 "higher"
 UTF-8 chars. This may need a workaround in JS too.

 Also, as UI Autocomplete always expects JSON response, we should be using
 `wp_send_json_error();` instead of `wp_die()` and probably better to use
 `wp_send_json_success();`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28307#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list