Plugin Directory

Changeset 1393395


Ignore:
Timestamp:
04/12/2016 09:47:05 PM (10 years ago)
Author:
KCPT
Message:

Search now accounts for numbers and encoded characters

Location:
rest-api-search/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • rest-api-search/trunk/lib/class-wp-rest-search-controller.php

    r1392536 r1393395  
    335335        }
    336336
    337         $page = intval ( $page );
    338 
     337        $page   = intval ( $page );
    339338        $search = implode ( ' ', explode ( "+", $search ) );
    340 
    341         $query = new WP_Query();
     339        $search = urldecode ( $search );
     340       
     341        $query  = new WP_Query();
    342342
    343343        $items = $query->query ( array (
     
    534534    {
    535535
    536         register_rest_route ( $this->namespace, '/' . $this->base . '/(?P<search>[a-zA-Z+]*)[/]*(?P<page>\d*)', array (
    537             'methods'  => WP_REST_Server::READABLE,
    538             'callback' => array ( $this, 'get_items' ),
    539             'args'     => array (
    540                 'class' => array (
    541                     'default' => 'col-md-4'
    542                 ),
    543                 's'     => false
    544             ),
    545         ) );
     536        register_rest_route ( $this->namespace, '/' . $this->base . '/(?P<search>[a-zA-Z0-9\%+]*)[/]*(?P<page>\d*)',
     537            array (
     538                'methods'  => WP_REST_Server::READABLE,
     539                'callback' => array ( $this, 'get_items' ),
     540                'args'     => array (
     541                    'class' => array (
     542                        'default' => 'col-md-4'
     543                    ),
     544                    's'     => false
     545                ),
     546            ) );
    546547
    547548    }
  • rest-api-search/trunk/readme.txt

    r1392536 r1393395  
    55Requires at least: 4.4
    66Tested up to: 4.4.2
    7 Stable tag: 1.2
     7Stable tag: 1.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7474= 1.2 =
    7575* Bug Fix - namespace variable of class needs to be protected.
     76
     77= 1.3 =
     78* Now allows for encoded characters and numbers in the url
  • rest-api-search/trunk/rest-api-search.php

    r1392536 r1393395  
    44Plugin URI:  https://github.com/KCPT19/REST-API-Search
    55Description: Adds in the missing search functionality of all post types to the REST API v2 plugin.
    6 Version:     1.2
     6Version:     1.3
    77Author:      KCPT
    88Author URI:  https://github.com/orgs/KCPT19
Note: See TracChangeset for help on using the changeset viewer.