Plugin Directory

Changeset 2579014


Ignore:
Timestamp:
08/05/2021 11:27:19 PM (5 years ago)
Author:
codingmall
Message:

Correction for next, previous links in main site.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cm-multisite-lite/trunk/index.php

    r2579009 r2579014  
    66Author: CodingMall.com
    77Author URI: https://codingmall.com/wordpress/
    8 Version: 1.0.0
     8Version: 1.0.1
    99License: GPLv2 (or later)
    1010Text Domain: cm-ms-lite
     
    2626    static $dom ='';
    2727    static $mDom='';
    28     static $aid ='';
     28    static $aid =0;
     29    static $isMain=false;
    2930   
    3031    static function initVars(){
    3132        self::$dom  = @$_SERVER['HTTP_HOST'];
    3233        self::$mDom = parse_url(get_option('siteurl'),PHP_URL_HOST);
     34
     35        if (self::$dom==self::$mDom) cm__msl_fe_global::$isMain=true;
    3336       
    3437        self::$aid  = self::getAid(self::$dom);
     
    5659
    5760    add_filter( "get_next_post_where", function($where, $in_same_term, $excluded_terms, $taxonomy, $post){
    58       $where .= " AND p.post_author='".cm__msl_fe_global::$aid."'";
    59       return $where;
     61        if (cm__msl_fe_global::$isMain) return $where;
     62       
     63        $where .= " AND p.post_author='".cm__msl_fe_global::$aid."'";
     64        return $where;
    6065    }, 10, 5);
    6166
    6267    add_filter( "get_previous_post_where", function($where, $in_same_term, $excluded_terms, $taxonomy, $post){
    63       $where .= " AND p.post_author='".cm__msl_fe_global::$aid."'";
    64       return $where;
     68        if (cm__msl_fe_global::$isMain) return $where;
     69       
     70        $where .= " AND p.post_author='".cm__msl_fe_global::$aid."'";
     71        return $where;
    6572    }, 10, 5);
    6673   
Note: See TracChangeset for help on using the changeset viewer.