diff --git a/README.md b/README.md index 3474602..08f5bcb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/jarvis.php b/jarvis.php index 5adce12..767e354 100755 --- a/jarvis.php +++ b/jarvis.php @@ -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 @@ -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); + } /** @@ -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', @@ -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 diff --git a/package.json b/package.json index 75c9195..b1702e5 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/readme.txt b/readme.txt index 4eec217..c0147f1 100644 --- a/readme.txt +++ b/readme.txt @@ -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 @@ -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