Plugin Directory

Changeset 1394427


Ignore:
Timestamp:
04/13/2016 04:43:10 PM (10 years ago)
Author:
KCPT
Message:

Added posts per page to default to settings set in WordPress

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

Legend:

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

    r1393395 r1394427  
    330330        $search = $request->get_param ( 'search' );
    331331        $page   = $request->get_param ( 'page' );
     332        $postsPerPage = get_option('posts_per_page');
     333
     334        if( ! $postsPerPage )
     335            $postsPerPage = 10;
    332336
    333337        if ( empty( $page ) ) {
     
    338342        $search = implode ( ' ', explode ( "+", $search ) );
    339343        $search = urldecode ( $search );
    340        
     344
    341345        $query  = new WP_Query();
    342346
     
    344348            'paged'          => $page,
    345349            'post_type'      => 'any',
    346             'posts_per_page' => 10,
     350            'posts_per_page' => $postsPerPage,
    347351            's'              => $search
    348352        ) );
  • rest-api-search/trunk/readme.txt

    r1393395 r1394427  
    55Requires at least: 4.4
    66Tested up to: 4.4.2
    7 Stable tag: 1.3
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7777= 1.3 =
    7878* Now allows for encoded characters and numbers in the url
     79
     80= 1.4 =
     81* WordPress's posts per page settings now are used.
  • rest-api-search/trunk/rest-api-search.php

    r1393395 r1394427  
    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.3
     6Version:     1.4
    77Author:      KCPT
    88Author URI:  https://github.com/orgs/KCPT19
Note: See TracChangeset for help on using the changeset viewer.