Changeset 1948389
- Timestamp:
- 09/28/2018 05:38:03 AM (7 years ago)
- Location:
- advanced-admin-search/trunk
- Files:
-
- 1 added
- 2 edited
-
Makefile (added)
-
README.md (modified) (2 diffs)
-
advanced-admin-search.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-admin-search/trunk/README.md
r1948008 r1948389 5 5 Requires at least: 3.9 6 6 Tested up to: 4.9.8 7 Stable tag: 4.9.87 Stable tag: 0.9.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 49 49 == Changelog == 50 50 51 = 0.9.1 = 52 * Support for custom post types 53 * Bug fixes 51 54 = 0.9 = 52 55 * Hello WordPress! -
advanced-admin-search/trunk/advanced-admin-search.php
r1948008 r1948389 4 4 Plugin URI: https://www.kuroit.com/product/advanced-admin-search 5 5 description: A WordPress plugin which adds extra searching feature into admin bar. 6 Version: 0.9 6 Version: 0.9.1 7 7 Author: Kuroit 8 8 Author URI: https://www.kuroit.com … … 44 44 45 45 $params = array( 46 'ajaxurl' => admin_url('admin-ajax.php' , 'https'),46 'ajaxurl' => admin_url('admin-ajax.php'), 47 47 'ajax_nonce' => wp_create_nonce('advanced_search_submit'), 48 48 ); … … 92 92 if(!empty($post_search)) 93 93 { 94 95 $post_types = get_post_types(array('public' => true)); 96 $post_types = array_values($post_types); 97 94 98 // get the register user. 95 99 $users = get_users( array( 'search' => "*{$post_search}*", 'fields' => array( 'display_name', 'user_registered', 'id' ) ) ); … … 97 101 98 102 foreach ( $users as $user ) { 99 $url = admin_url( 'user-edit.php?user_id='.$user->id , 'https');103 $url = admin_url( 'user-edit.php?user_id='.$user->id ); 100 104 101 105 $getUser = get_userdata( $user->id ); … … 104 108 105 109 foreach ($role as $value) { 106 echo "<li class='search_rows'><a class='search_result' href='".$url."'><img class='image_thumb' src='".esc_url( get_avatar_url( $user->ID ) )."'>" . $user->display_name . "<p class='list_status'>" . $value."</p><p class='list_type'>" . $user->user_registered . "</p></a></li>";110 echo "<li class='search_rows'><a class='search_result' href='".$url."'><img class='image_thumb' src='".esc_url( get_avatar_url( $user->ID ) )."'>" . $user->display_name . "<p class='list_status'>" . $value . "</p><p class='list_type'>" . $user->user_registered . "</p></a></li>"; 107 111 } 108 112 } … … 115 119 $posts = get_posts( 116 120 array( 117 's' => $post_search, 118 'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'trash'), 119 'posts_per_page' => $postPerPage 121 's' => $post_search, 122 'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'future', 'private', 'trash'), 123 'post_type' => 'any', 124 'posts_per_page' => $postPerPage 120 125 ) 121 126 ); … … 124 129 125 130 foreach ($posts as $post) { 126 $url = admin_url( 'post.php?post='.$post->ID.'&action=edit' , 'https');131 $url = admin_url( 'post.php?post='.$post->ID.'&action=edit' ); 127 132 $post_type = $post->post_type; 128 133 … … 148 153 149 154 foreach ($mediaPosts as $mediaPost) { 150 $url = admin_url( 'post.php?post='.$mediaPost->ID.'&action=edit' , 'https');155 $url = admin_url( 'post.php?post='.$mediaPost->ID.'&action=edit' ); 151 156 $post_type = $mediaPost->post_type; 152 153 echo "<li class='search_rows'><a class='search_result' href='".$url."''><img class='image_thumb' src='".$mediaPost->guid."'>".$mediaPost->post_title."<p class='list_type'>".$mediaPost->post_date."</p></a></li>"; 157 $image_url = wp_get_attachment_image_src($mediaPost->ID); 158 159 echo "<li class='search_rows'><a class='search_result' href='".$url."''><img class='image_thumb' src='".$image_url[0]."'>".$mediaPost->post_title."<p class='list_type'>".$mediaPost->post_date."</p></a></li>"; 154 160 } 155 161 }
Note: See TracChangeset
for help on using the changeset viewer.