Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  post type check in query
  update wordpress.org readme

# Conflicts:
#	readme.txt
  • Loading branch information
kshaner committed Apr 27, 2016
2 parents a442acf + 2f149f8 commit 701c81d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ You may be on a page that's focusing on a text area or input box. If this is the
* add user setting for invoking jarvis
6. 0.50.0
* Refactored to use the latest Twitter Typeahead
7. 0.51.0
* Add post type check to search query to only query post types shown in wp-admin


## Authors
Expand Down
7 changes: 6 additions & 1 deletion jarvis.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Jarvis
Plugin URI: http://www.wpjarvis.com
Description: Jarvis is your administration assistant, putting WordPress at your fingertips.
Version: 0.50.0
Version: 0.51.0
Author: wdgdc, David Everett, Joan Piedra, Kurtis Shaner
Author URI: http://www.webdevelopmentgroup.com
License: GPLv2 or later
Expand Down Expand Up @@ -40,6 +40,7 @@ private function __construct() {
add_action('personal_options_update', array($this, 'edit_user_profile_update'));
add_action('show_user_profile', array($this, 'show_user_profile'));
add_action('wp_ajax_jarvis-search', array($this, 'get_search_results'), 1);

}

/**
Expand Down Expand Up @@ -230,6 +231,8 @@ public function get_search_results() {
$srch_qry = $wpdb->esc_like($_REQUEST['q']);
$srch_escaped_spaces = '%'.str_replace(' ', '%', $srch_qry).'%';

$post_types = "'".implode("','", array_values(get_post_types(array('show_ui' => true))))."'";

$strQry = "SELECT
$wpdb->terms.term_id as 'id',
$wpdb->terms.`name` as 'title',
Expand Down Expand Up @@ -263,6 +266,8 @@ public function get_search_results() {
$wpdb->posts
WHERE
$wpdb->posts.post_status NOT IN ('revision', 'auto-draft') AND $wpdb->posts.post_type <> 'revision'
AND
$wpdb->posts.post_type IN ($post_types)
AND (
$wpdb->posts.post_title LIKE %s
OR
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jarvis",
"version": "0.50.0",
"version": "0.51.0",
"description": " Jarvis is your admin assistant, putting WordPress at your fingertips via a quicksearch interface.",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 6 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Tags: jarvis, wordpress, plugin, posts, pages, search, launchbar, admin, menu
Author URI: http://www.webdevelopmentgroup.com
Author: wdgdc
Requires at least: 3.3
Tested up to: 4.5
Stable tag: 0.50.0
Version: 0.50.0
Tested up to: 4.5.1
Stable tag: 0.51.0
Version: 0.51.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Donate link: http://www.webdevelopmentgroup.com
Expand Down Expand Up @@ -80,3 +80,6 @@ You may be on a page that's focusing on a text area or input box. If this is the

= 0.50.0 =
* Refactored to use the latest Twitter Typeahead

= 0.51.0 =
* Add post type check to search query to only query post types shown in wp-admin

0 comments on commit 701c81d

Please sign in to comment.