Plugin Directory

Changeset 1958609


Ignore:
Timestamp:
10/18/2018 01:10:51 PM (7 years ago)
Author:
8bitsinarow
Message:

Fixed pagination issue caused by redirect

Location:
basepress/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • basepress/trunk/basepress.php

    r1948559 r1958609  
    55 * Plug URI: http://www.8bitsinarow.com
    66 * Description: The perfect Knowledge Base plugin for WordPress
    7  * Version: 1.8.10
     7 * Version: 1.8.11
    88 * Author: 8Bits in a row
    99 * Author URI: http://www.8bitsinarow.com
     
    7373             * @var string
    7474             */
    75             public  $ver = '1.8.10' ;
     75            public  $ver = '1.8.11' ;
    7676            /**
    7777             * Database version
  • basepress/trunk/includes/class-basepress-utils.php

    r1948559 r1958609  
    8484         * @since 1.8.9
    8585         *
     86         * @updated 1.8.11
     87         *
    8688         * @param $request
    8789         * @return mixed
    8890         */
    8991        public function redirections( $request ){
    90             global $wp;
     92            global $wp, $wp_rewrite;;
    9193
    9294            //If we are in the Admin or Pretty permalinks are not enabled return the request unchanged
     
    102104                    $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
    103105                    $post_permalink = get_permalink( $post->ID );
     106                    if( isset( $request['page'] ) ){
     107                        $post_permalink = $post_permalink . $request['page'] . '/';
     108                    }
     109                    if( isset( $request['cpage'] ) ){
     110                        $comment_page_base = $wp_rewrite->comments_pagination_base;
     111                        $post_permalink = $post_permalink . $comment_page_base . '-' . $request['cpage'] . '/';
     112                    }
    104113
    105114                    //If the current URL don't match with the post permalink redirect with a 301
     
    131140                    $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
    132141                    $section_permalink = get_term_link( $section, 'knowledgebase_cat' );
     142                    if( isset( $request['paged'] ) ){
     143                        $page_base = $wp_rewrite->pagination_base;
     144                        $section_permalink = $section_permalink . $page_base . '/' . $request['paged'] . '/';
     145                    }
     146
    133147
    134148                    //If the current URL don't match with the section permalink redirect with a 301
  • basepress/trunk/readme.txt

    r1948559 r1958609  
    55Requires at least: 4.5
    66Tested up to: 4.9.8
    7 Stable tag: 1.8.10
     7Stable tag: 1.8.11
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    139139== Changelog ==
    140140
     141= 1.8.11 =
     142* Fixed pagination that stopped working after version 1.8.9
     143
    141144= 1.8.10 =
    142145* Improved articles list in sections. Now it shows the articles from that section and a list of sub-sections if present
Note: See TracChangeset for help on using the changeset viewer.