Plugin Directory

Changeset 1592729


Ignore:
Timestamp:
02/09/2017 07:23:33 PM (9 years ago)
Author:
wpklangoo
Message:

Bug fixes

Location:
magnet/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • magnet/trunk/README.txt

    r1588183 r1592729  
    33Tags: Klangoo, Magnet, Related articles, Recommended articles, Summary, Personalization, Analytics, Semantic, Analysis, Entity, Entities, Names, In-text links, SEO, interlinking
    44Requires at least: 4.0
    5 Tested up to: 4.7
     5Tested up to: 4.7.2
    66Stable tag: trunk
    77License: GPLv2 or later
     
    4646
    4747== Changelog ==
     48= 1.0.11 =
     49* Bug fixes.
    4850= 1.0.10 =
    4951* Bug fixes.
  • magnet/trunk/WP-klangoo.php

    r1588183 r1592729  
    55Plugin URI: http://magnet.klangoo.com/wp-plugin
    66Description: This plugin allows Klangoo clients to integrate our services inside their WordPress sites with ease.
    7 Version: 1.0.10
     7Version: 1.0.11
    88Author: Klangoo
    99Author URI: http://klangoo.com
     
    4343    }
    4444
    45     if( -900 != get_the_ID() && -800 != get_the_ID() ) {
    46         if ( $page_type == "article" ) {
     45    if( -900 != get_the_ID() && -800 != get_the_ID() && -700 != get_the_ID() ) {
     46        if ( "article" == $page_type ) {
    4747            ?>
    4848            <meta itemprop="identifier" content="<?php the_ID(); ?>"/>
     
    6868            <?php
    6969        }
    70     }elseif ( get_the_ID() == -900 ){
     70    }elseif ( -900 == get_the_ID() ){
    7171        ?>
    7272        <meta itemprop="pageType" content="relart" />
    7373        <?php
    74     }elseif( get_the_ID() == -800 ){
     74    }elseif( -800 == get_the_ID || -700 == get_the_ID ){
    7575        ?>
    7676        <meta itemprop="pageType" content="entrelart" />
     
    258258}
    259259
    260 function magnet_rewrite_add_rewrites()
    261 {
    262     add_rewrite_rule(
    263         '^entities/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$',
    264         'index.php?pagename=entities&entid=$matches[1]&entname=$matches[2]&lang=$matches[3]&paged=$matches[4]',
    265         'top'
    266     );
    267    
    268         add_rewrite_rule(
    269         '^entities/([^/]+)/([^/]+)/([^/]+)/?$',
    270         'index.php?pagename=entities&entid=$matches[1]&entname=$matches[2]&lang=$matches[3]',
    271         'top'
    272     );
    273     flush_rewrite_rules();
    274 }
    275 
    276260/* Runs on plugin deactivation*/
    277261register_deactivation_hook( __FILE__, 'magnet_remove' );
    278 //register_activation_hook( __FILE__, 'magnet_rewrite_add_rewrites' );
    279262
    280263add_action( 'wp_head', 'magnet_head' );
  • magnet/trunk/class-fake-page.php

    r1588183 r1592729  
    138138         * Check if the requested page matches our target
    139139         */
    140 
    141140        if ( strtolower( $wp -> request ) == strtolower( $this -> rel_article_slug ) || ( isset( $wp->query_vars['page_id'] ) && $wp -> query_vars[ "page_id" ] == $this -> rel_article_slug ) ) {
     141            $posts = array();
    142142            $post = $this -> createPost( $this -> rel_article_slug, $this -> rel_article_title, -900 );
    143             $posts = array();
    144             $posts[] = $post;
    145             /**
    146              * Trick wp_query into thinking this is a page (necessary for wp_title() at least)
    147              * Not sure if it's cheating or not to modify global variables in a filter
    148              * but it appears to work and the codex doesn't directly say not to.
    149              */
    150             $wp_query->queried_object = $post;
    151             $wp_query -> is_page = true;
    152             //Not sure if this one is necessary but might as well set it like a true page
    153             $wp_query -> is_singular = false;
    154             $wp_query -> is_single = false;
    155             $wp_query -> is_home = false;
    156             $wp_query -> is_archive = false;
    157             $wp_query -> is_category = false;
    158             //Longer permalink structures may not match the fake post slug and cause a 404 error so we catch the error here
    159             unset( $wp_query -> query[ "error" ] );
    160             $wp_query -> query_vars[ "error" ] = "";
    161             $wp_query -> is_404 = false;
     143            $posts[] = $post;
     144            $wp_query->queried_object = $post;
     145            $wp_query -> is_page = true;
     146            //Not sure if this one is necessary but might as well set it like a true page
     147            $wp_query -> is_singular = false;
     148            $wp_query -> is_home = false;
     149            $wp_query -> is_archive = false;
     150            $wp_query -> is_category = false;
     151            //Longer permalink structures may not match the fake post slug and cause a 404 error so we catch the error here
     152            unset( $wp_query -> query[ "error" ] );
     153            $wp_query -> query_vars[ "error" ] = "";
     154            $wp_query -> is_404 = false;
    162155        }elseif( strtolower( $wp -> request ) == strtolower( $this -> rel_entity_slug ) || ( isset( $wp->query_vars['page_id'] ) && $wp -> query_vars[ "page_id" ] == $this -> rel_entity_slug ) ) {
    163             $posts = array();
     156            $posts = array();
    164157            $post = $this -> createPost( $this -> rel_entity_slug, $this -> rel_entity_title, -800 );
    165             $posts[] = $post;
    166 
    167             $wp_query->queried_object = $post;
    168             $wp_query -> is_page = true;
    169             //Not sure if this one is necessary but might as well set it like a true page
    170             $wp_query -> is_singular = false;
    171             $wp_query -> is_home = false;
    172             $wp_query -> is_archive = false;
    173             $wp_query -> is_category = false;
    174             //Longer permalink structures may not match the fake post slug and cause a 404 error so we catch the error here
    175             unset( $wp_query -> query[ "error" ] );
    176             $wp_query -> query_vars[ "error" ] = "";
    177             $wp_query -> is_404 = false;
    178         }elseif( ( strpos ( strtolower( $wp -> request ), strtolower( $this -> rel_entity_slug_new )) == 0 )  || ( isset( $wp -> query_vars['page_id'] ) && $wp -> query_vars[ "page_id" ] == $this -> rel_entity_slug_new ) ) {
    179             $posts = array();
     158            $posts[] = $post;
     159            $wp_query->queried_object = $post;
     160            $wp_query -> is_page = true;
     161            //Not sure if this one is necessary but might as well set it like a true page
     162            $wp_query -> is_singular = false;
     163            $wp_query -> is_home = false;
     164            $wp_query -> is_archive = false;
     165            $wp_query -> is_category = false;
     166            //Longer permalink structures may not match the fake post slug and cause a 404 error so we catch the error here
     167            unset( $wp_query -> query[ "error" ] );
     168            $wp_query -> query_vars[ "error" ] = "";
     169            $wp_query -> is_404 = false;
     170        }elseif( strtolower( $wp -> request ) == strtolower( $this -> rel_entity_slug_new )  || ( isset( $wp -> query_vars['page_id'] ) && $wp -> query_vars[ "page_id" ] == $this -> rel_entity_slug_new ) ) {
     171            $posts = array();
    180172            $post = $this -> createPost( $this -> rel_entity_slug_new, $this -> rel_entity_title, -700 );
    181             $posts[] = $post;
    182  
    183             $wp_query->queried_object = $post;
    184             $wp_query -> is_page = true;
    185             //Not sure if this one is necessary but might as well set it like a true page
    186             $wp_query -> is_singular = false;
    187             $wp_query -> is_home = false;
    188             $wp_query -> is_archive = false;
    189             $wp_query -> is_category = false;
    190             //Longer permalink structures may not match the fake post slug and cause a 404 error so we catch the error here
    191             unset( $wp_query -> query[ "error" ] );
    192             $wp_query -> query_vars[ "error" ] = "";
    193             $wp_query -> is_404 = false;
     173            $posts[] = $post;
     174            $wp_query->queried_object = $post;
     175            $wp_query -> is_page = true;
     176            //Not sure if this one is necessary but might as well set it like a true page
     177            $wp_query -> is_singular = false;
     178            $wp_query -> is_home = false;
     179            $wp_query -> is_archive = false;
     180            $wp_query -> is_category = false;
     181            //Longer permalink structures may not match the fake post slug and cause a 404 error so we catch the error here
     182            unset( $wp_query -> query[ "error" ] );
     183            $wp_query -> query_vars[ "error" ] = "";
     184            $wp_query -> is_404 = false;
    194185        }
    195 
     186           
    196187        return $posts;
    197188    }
Note: See TracChangeset for help on using the changeset viewer.