Plugin Directory

Changeset 745113


Ignore:
Timestamp:
07/23/2013 06:22:39 PM (13 years ago)
Author:
iluminatus
Message:

Bug fix for duplicated filter when using multiple instances and time frame

Location:
single-latest-posts-lite/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • single-latest-posts-lite/trunk/readme.txt

    r744585 r745113  
    55Requires at least: 3.0
    66Tested up to: 3.5.1
    7 Stable tag: 1.4.1
     7Stable tag: 1.4.2
    88
    99This plugin allows you to pull all the recent posts from your WordPress blog and display them the way you want
     
    8080== Changelog ==
    8181
     82= 1.4.2 =
     83* Bug fix: Checking if filter_where exists when using time frame and multiple instances to avoid duplicate function fatal errors.
     84
    8285= 1.4.1 =
    8386* Minor bug fix: removed debugging JavaScript code.
  • single-latest-posts-lite/trunk/single-latest-posts.php

    r744585 r745113  
    44Plugin URI: http://wordpress.org/extend/plugins/single-latest-posts-lite/
    55Description: Display the latest posts available in your WordPress blog using functions, shortcodes or widgets.
    6 Version: 1.4.1
     6Version: 1.4.2
    77Author: L'Elite
    88Author URI: http://laelite.info/
     
    11691169        // Nasty hack to access this variable from inside callback filters
    11701170        $GLOBALS['slp_time_frame'] = (int)$time_frame;
    1171         function filter_where( $where ) {
    1172             $days = (int)$GLOBALS['slp_time_frame'];
    1173             $where .= " AND post_date >= '".date('Y-m-d', strtotime("-$days days"))."'";
    1174             return $where;
     1171        if( !function_exists( 'filter_where' ) ) {
     1172            function filter_where( $where ) {
     1173                $days = (int)$GLOBALS['slp_time_frame'];
     1174                $where .= " AND post_date >= '".date('Y-m-d', strtotime("-$days days"))."'";
     1175                return $where;
     1176            }
    11751177        }
    11761178        add_filter( 'posts_where', 'filter_where' );
Note: See TracChangeset for help on using the changeset viewer.