Manage links redesign. Add link search.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-02-12 08:01:32 +00:00
parent 079e285537
commit 1bd097fff0
3 changed files with 49 additions and 25 deletions

View File

@@ -111,7 +111,7 @@ function get_bookmarks($args = '') {
'limit' => -1, 'category' => '',
'category_name' => '', 'hide_invisible' => 1,
'show_updated' => 0, 'include' => '',
'exclude' => ''
'exclude' => '', 'search' => ''
);
$r = wp_parse_args( $args, $defaults );
@@ -160,6 +160,11 @@ function get_bookmarks($args = '') {
$category = $category->term_id;
}
if ( ! empty($search) ) {
$search = like_escape($search);
$search = " AND ( (link_url LIKE '%$search%') OR (link_name LIKE '%$search%') OR (link_description LIKE '%$search%') ) ";
}
$category_query = '';
$join = '';
if ( !empty($category) ) {
@@ -207,7 +212,7 @@ function get_bookmarks($args = '') {
$visible = "AND link_visible = 'Y'";
$query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query";
$query .= " $exclusions $inclusions";
$query .= " $exclusions $inclusions $search";
$query .= " ORDER BY $orderby $order";
if ($limit != -1)
$query .= " LIMIT $limit";