Plugin Directory

Changeset 1114203


Ignore:
Timestamp:
03/16/2015 10:42:56 PM (11 years ago)
Author:
wpkonsulent
Message:

Update push for 1.2

Location:
search-by-id/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • search-by-id/trunk/readme.txt

    r1003294 r1114203  
    11=== Search by ID ===
    22Contributors: wpkonsulent
    3 Tags: search, posts, pages, custom post types, id, admin
    4 Requires at least: 3.0.1
    5 Tested up to: 4.0
    6 Stable tag: 1.1
     3Tags: search, posts, pages, custom post types, media, id, admin
     4Requires at least: 4.0
     5Tested up to: 4.1.1
     6Stable tag: 1.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515
    1616= Features: =
    17 * Works for all kinds of posts (regular posts, pages, custom post types).
     17* Works for all kinds of posts (regular posts, pages, custom post types and media).
    1818* No configuration needed.
    19 * Doesn't add javascript or css.
     19* Doesn't add javascript or css; it has virtually no impact whatsoever.
    2020* No front-end functionality, just back-end.
    2121* Doesn't add any options or tables to the database.
    2222
    23 Just a nice and easy, seamless extension of the built-in search.
     23Just a nice, clean and easy, seamless extension of the built-in search.
    2424
    2525= How to use it: =
     
    4545There is nothing new to be found, my friend. It hooks into the good old search input field you see in the top right corner when viewing the lists of posts (or pages, or whatever post type you may use). Just enter an ID into that field, and you will see.
    4646
     47= It's not working =
     48
     49That's not really a very descriptive question, but I shall try to answer nonetheless ;). If you find that searching for an ID that definitely does exist does not work, it's most likely because you have another plugin installed that interferes with the same filter that this plugin uses. I'm afraid I can't do anything about that.
     50
    4751== Screenshots ==
    4852
     
    5155== Changelog ==
    5256
     57= 1.2 =
     58
     59* Updated for 4.1.1. Slight rewrite of the filter was necessary. Updated description and FAQ.
     60
    5361= 1.1 =
    5462* Added support for searching multiple IDs. Credit goes to Ben Wise for suggesting this.
  • search-by-id/trunk/search-by-id.php

    r726666 r1114203  
    33    Plugin Name: Search by ID
    44    Plugin URI:
    5     Description: Enables the user to search by post ID using the built-in search within the administration area. Works for all kinds of posts (posts, pages, custom post types).
    6     Version: 1.1
     5    Description: Enables the user to search by post ID using the built-in search within the administration area. Works for all kinds of posts (posts, pages, custom post types and media).
     6    Version: 1.2
    77    Author: Uffe Fey, WordPress consultant
    88    Author URI: http://wpkonsulent.dk
    99*/
    10     $wpkonsulent_searchbyid = new WPkonsulentSearchById();
     10    new WPkonsulentSearchById();
    1111   
    1212    class WPkonsulentSearchById
    1313    {
    14         function WPkonsulentSearchById()
    15         {
    16             $this->__construct();
    17         }
    18 
    1914        function __construct()
    2015        {
     
    3328                    {
    3429                        global $wpdb;
    35                         $where .= ' or ' . $wpdb->posts . '.ID = ' . $s;
     30                       
     31                        $where = str_replace('(' . $wpdb->posts . '.post_title LIKE', '(' . $wpdb->posts . '.ID = ' . $s . ') OR (' . $wpdb->posts . '.post_title LIKE', $where);
    3632                    }
    3733                    elseif(preg_match("/^(\d+)(,\s*\d+)*\$/", $s)) // string of post IDs
    3834                    {
    3935                        global $wpdb;
    40                         $where .= ' or ' . $wpdb->posts . '.ID in (' . $s . ')';
     36                       
     37                        $where = str_replace('(' . $wpdb->posts . '.post_title LIKE', '(' . $wpdb->posts . '.ID in (' . $s . ')) OR (' . $wpdb->posts . '.post_title LIKE', $where);
    4138                    }
    4239                }
Note: See TracChangeset for help on using the changeset viewer.