[wp-trac] [WordPress Trac] #20487: Comment search isn't customizable
WordPress Trac
wp-trac at lists.automattic.com
Thu Apr 19 20:44:10 UTC 2012
#20487: Comment search isn't customizable
-----------------------------------+------------------------------
Reporter: brokentone | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 3.2.1
Severity: normal | Resolution:
Keywords: needs-patch has-patch |
-----------------------------------+------------------------------
Comment (by scribu):
> It will be difficult to design a plugin to have a similar UX without
greater core support. I would have to create a separate page to host the
advanced search form
You can modify it via JavaScript.
> When an admin clicks on the IP address of a comment, the logical outcome
would be to do an exact search on only the comment_author_IP field. The
expectation would not be to look for the IP as a string within author
emails, comment text, etc. Having the functionality in the objects can
allow this logical outcome even without an advanced search form.
WP_User_Query restricts what fields are searched based on the search
string:
{{{
$search_columns = array();
if ( $qv['search_columns'] )
$search_columns = array_intersect( $qv['search_columns'], array(
'ID', 'user_login', 'user_email', 'user_url', 'user_nicename' ) );
if ( ! $search_columns ) {
if ( false !== strpos( $search, '@') )
$search_columns = array('user_email');
elseif ( is_numeric($search) )
$search_columns = array('user_login', 'ID');
elseif ( preg_match('|^https?://|', $search) && !
wp_is_large_network( 'users' ) )
$search_columns = array('user_url');
else
$search_columns = array('user_login', 'user_nicename');
}
}}}
Maybe we can do something similar here.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20487#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list