Plugin Directory

Changeset 219890


Ignore:
Timestamp:
03/20/2010 01:24:32 PM (16 years ago)
Author:
timhodson
Message:

version 0.9.9.1 fixed apply_filters loops

Location:
blog-in-blog
Files:
6 edited
7 copied

Legend:

Unmodified
Added
Removed
  • blog-in-blog/tags/0.9.9.1/bib_post_template.tpl

    r218488 r219890  
    1 <!--fragment of html for post template blog-in-blog Version: 0.9.9 -->
     1<!--fragment of html for post template blog-in-blog Version: 0.9.9.1 -->
    22<div class="post">
    33<!-- Post Headline -->     
  • blog-in-blog/tags/0.9.9.1/blog-in-blog.php

    r218488 r219890  
    55Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/
    66Description: Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
    7 Version: 0.9.9
     7Version: 0.9.9.1
    88Author: Tim Hodson
    99Author URI: http://timhodson.com
     
    3434include_once( WP_PLUGIN_DIR."/blog-in-blog/options.php" );
    3535
    36 
    37 
    3836$plugin_dir = basename(dirname(__FILE__));
    3937load_plugin_textdomain( 'blog-in-blog', 'wp-content/plugins/' . $plugin_dir, $plugin_dir );
    4038
     39#global $BIB_RUN  ;
     40#if ($BIB_RUN != 1) { $BIB_RUN=0; }
     41#echo $BUB_RUN;
    4142
    4243function blog_in_blog_func($atts) {
    4344    global $blog_in_blog_opts;
    4445    global $wp_query;
    45 
     46   
     47    // prevent infinite loops...
     48    // now that we have started our first blog-in-blog processing, we make sure that we don't do it again.
     49    remove_shortcode('blog_in_blog');
     50    // we also now make sure the shortcode text is removed from the post content by other plugins.
     51    add_filter( 'the_content', 'bib_remove_shortcode' ) ;
     52   
    4653    extract(shortcode_atts(array (
    4754    'category_id' => '1',
     
    117124        $data['post_author_avatar'] = get_avatar( $post->post_author , $blog_in_blog_opts['bib_avatar_size'] );
    118125
    119         #$data['post_content'] = apply_filters('the_content', $post->post_content);
    120         $data['post_content'] = $post->post_content;
    121        
    122         #$data['post_excerpt'] = apply_filters('the_excerpt', bib_process_excerpt($post) );
    123         $data['post_excerpt'] = bib_process_excerpt($post) ;
     126        $data['post_content'] = apply_filters('the_content', $post->post_content);
     127        #$data['post_content'] = $post->post_content;
     128       
     129        $data['post_excerpt'] = apply_filters('the_excerpt', bib_process_excerpt($post) );
     130        #$data['post_excerpt'] = bib_process_excerpt($post) ;
    124131       
    125132        $data['post_permalink'] = get_permalink($post);
     
    150157    }
    151158
     159    #$BIB_RUN = 1;
     160
    152161    // return the posts data.
    153162    return $out;
    154163}
    155164add_shortcode('blog_in_blog', 'blog_in_blog_func');
     165
     166
     167/**
     168 * Filter to remove the shortcode to prevent display after other functions have applied the_content filter
     169 */
     170
     171function bib_remove_shortcode($content=''){
     172    $content = preg_replace("/\[blog_in_blog.*\]/","",$content);
     173    //echo "The Content from bib_remove_shortcode:(".$content.")";
     174    return $content;
     175}
     176
     177
    156178
    157179/**
     
    389411    return $out;
    390412}
     413
     414
    391415/**
    392416 * Page navi
     
    528552}
    529553
     554
    530555function bib_get_post_count() {
    531556    global $wpdb;
  • blog-in-blog/tags/0.9.9.1/readme.txt

    r218488 r219890  
    55Requires at least: 2.7.1
    66Tested up to: 2.9.2
    7 Stable tag: 0.9.9
     7Stable tag: 0.9.9.1
    88
    99Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
     
    101101== Changelog ==
    102102
     103= 0.9.9.1 =
     104Tried a different fix for `apply_fiters()` issues. Basically other plugins and themes were calling `the_content` and attempting to reapply the blog-in-blog shortcode, causing max nested loops errors or infinite loops.
     105
    103106= 0.9.9 =
    104 Fixed issue causing infinite loop with ither plugins that call `appy_filters()` on `the_content` which will cause shortcode to be re-applied again and again.
     107Fixed issue causing infinite loop with other plugins that call `appy_filters()` on `the_content` which will cause shortcode to be re-applied again and again.
    105108
    106109= 0.9.8 =
  • blog-in-blog/trunk/bib_post_template.tpl

    r218488 r219890  
    1 <!--fragment of html for post template blog-in-blog Version: 0.9.9 -->
     1<!--fragment of html for post template blog-in-blog Version: 0.9.9.1 -->
    22<div class="post">
    33<!-- Post Headline -->     
  • blog-in-blog/trunk/blog-in-blog.php

    r218488 r219890  
    55Plugin URI: http://informationtakesover.co.uk/blog-in-blog-wordpress-plugin/
    66Description: Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
    7 Version: 0.9.9
     7Version: 0.9.9.1
    88Author: Tim Hodson
    99Author URI: http://timhodson.com
     
    3434include_once( WP_PLUGIN_DIR."/blog-in-blog/options.php" );
    3535
    36 
    37 
    3836$plugin_dir = basename(dirname(__FILE__));
    3937load_plugin_textdomain( 'blog-in-blog', 'wp-content/plugins/' . $plugin_dir, $plugin_dir );
    4038
     39#global $BIB_RUN  ;
     40#if ($BIB_RUN != 1) { $BIB_RUN=0; }
     41#echo $BUB_RUN;
    4142
    4243function blog_in_blog_func($atts) {
    4344    global $blog_in_blog_opts;
    4445    global $wp_query;
    45 
     46   
     47    // prevent infinite loops...
     48    // now that we have started our first blog-in-blog processing, we make sure that we don't do it again.
     49    remove_shortcode('blog_in_blog');
     50    // we also now make sure the shortcode text is removed from the post content by other plugins.
     51    add_filter( 'the_content', 'bib_remove_shortcode' ) ;
     52   
    4653    extract(shortcode_atts(array (
    4754    'category_id' => '1',
     
    117124        $data['post_author_avatar'] = get_avatar( $post->post_author , $blog_in_blog_opts['bib_avatar_size'] );
    118125
    119         #$data['post_content'] = apply_filters('the_content', $post->post_content);
    120         $data['post_content'] = $post->post_content;
    121        
    122         #$data['post_excerpt'] = apply_filters('the_excerpt', bib_process_excerpt($post) );
    123         $data['post_excerpt'] = bib_process_excerpt($post) ;
     126        $data['post_content'] = apply_filters('the_content', $post->post_content);
     127        #$data['post_content'] = $post->post_content;
     128       
     129        $data['post_excerpt'] = apply_filters('the_excerpt', bib_process_excerpt($post) );
     130        #$data['post_excerpt'] = bib_process_excerpt($post) ;
    124131       
    125132        $data['post_permalink'] = get_permalink($post);
     
    150157    }
    151158
     159    #$BIB_RUN = 1;
     160
    152161    // return the posts data.
    153162    return $out;
    154163}
    155164add_shortcode('blog_in_blog', 'blog_in_blog_func');
     165
     166
     167/**
     168 * Filter to remove the shortcode to prevent display after other functions have applied the_content filter
     169 */
     170
     171function bib_remove_shortcode($content=''){
     172    $content = preg_replace("/\[blog_in_blog.*\]/","",$content);
     173    //echo "The Content from bib_remove_shortcode:(".$content.")";
     174    return $content;
     175}
     176
     177
    156178
    157179/**
     
    389411    return $out;
    390412}
     413
     414
    391415/**
    392416 * Page navi
     
    528552}
    529553
     554
    530555function bib_get_post_count() {
    531556    global $wpdb;
  • blog-in-blog/trunk/readme.txt

    r218488 r219890  
    55Requires at least: 2.7.1
    66Tested up to: 2.9.2
    7 Stable tag: 0.9.9
     7Stable tag: 0.9.9.1
    88
    99Create a blog within a blog using a category. This plugin basically shows posts in a category on a page using shortcodes.
     
    101101== Changelog ==
    102102
     103= 0.9.9.1 =
     104Tried a different fix for `apply_fiters()` issues. Basically other plugins and themes were calling `the_content` and attempting to reapply the blog-in-blog shortcode, causing max nested loops errors or infinite loops.
     105
    103106= 0.9.9 =
    104 Fixed issue causing infinite loop with ither plugins that call `appy_filters()` on `the_content` which will cause shortcode to be re-applied again and again.
     107Fixed issue causing infinite loop with other plugins that call `appy_filters()` on `the_content` which will cause shortcode to be re-applied again and again.
    105108
    106109= 0.9.8 =
Note: See TracChangeset for help on using the changeset viewer.