Plugin Directory

Changeset 467587


Ignore:
Timestamp:
11/25/2011 10:52:06 PM (14 years ago)
Author:
rfrankel
Message:

Added a test to see if get_current_screen exists before using it.
Fixed the queries so showposts and posts_per_page are both -1. This should override the WP posts per page setting in the backend. This was supposed to be fixed in 0.3 (see below) but it wasn't for certain themes.

Location:
wp-super-faq/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-super-faq/trunk/readme.txt

    r465818 r467587  
    55Requires at least: 3.1
    66Tested up to: 3.2.1
    7 Stable tag: 0.5.3
     7Stable tag: 0.5.4
    88
    99A lightweight FAQ/QNA plugin that includes an FAQ shortcode for your site. A simple jQuery animation is included to show/hide each question.
     
    1111== Description ==
    1212
    13 WP Super FAQ uses the WordPress 3.1+ custom post types and taxonomies to include support for an FAQ (Frequently Asked Questions) on your site.  The interface uses jQuery to provide a small animation that lets users click the questions they are interested in to display the answer.  The goal of this plugin was for extremely lightweight code that provides easy setup, addition of questions, and a clean user interface.  Also included in this plugin is the option of putting questions in different 'categories' to display.  Please see the screenshots for examples.  If you have feedback or questions head over to my [feedback and support](http://plugins.swampedpublishing.com/wp-super-faq) page for this plugin.
     13WP Super FAQ uses the WordPress 3.1+ custom post types and taxonomies to include support for an FAQ (Frequently Asked Questions/Question and Answer) on your site.  The interface uses jQuery to provide a small animation that lets users click the questions they are interested in to display the answer.  The goal of this plugin was for extremely lightweight code that provides easy setup, addition of questions, and a clean user interface.  Also included in this plugin is the option of putting questions in different 'categories' to display.  Please see the screenshots for examples.  If you have feedback or questions head over to my [feedback and support](http://plugins.swampedpublishing.com/wp-super-faq) page for this plugin.
    1414
    1515== Installation ==
     
    5252== Changelog ==
    5353
     54= 0.5.4 =
     55Added a test to see if get_current_screen exists before using it.
     56Fixed the queries so showposts and posts_per_page are both -1.  This should override the WP posts per page setting in the backend.  This was supposed to be fixed in 0.3 (see below) but it wasn't for certain themes.
     57
    5458= 0.5.3 =
    5559Fixed an error with the show_categories shortcode.  This bug causes funny line breaks in some themes.
     
    7983== Upgrade Notice ==
    8084
     85= 0.5.4 =
     86Added a test to see if get_current_screen exists before using it.
     87Fixed the queries so showposts and posts_per_page are both -1.  This should override the WP posts per page setting in the backend.  This was supposed to be fixed in 0.3 (see below) but it wasn't for certain themes.
     88
    8189= 0.5.3 =
    8290Fixed an error with the show_categories shortcode.  This bug causes funny line breaks in some themes.
  • wp-super-faq/trunk/wp_super_faq.php

    r465818 r467587  
    44Plugin URI: http://plugins.swampedpublishing.com/wp-super-faq
    55Description: A lightweight Wordpress Plugin that implements an FAQ page on your site using simple jQuery animation for a clean, usable interface.
    6 Version: 0.5.3
     6Version: 0.5.4
    77Author: rfrankel
    88Author URI: http://plugins.swampedpublishing.com/
     
    116116// Change title text in editor
    117117function wp_super_faq_custom_title_text( $title ){
    118     $screen = get_current_screen();
    119     if ( 'wp_super_faq' == $screen->post_type ) {
    120         $title = 'Enter question here';
     118    if (function_exists ('get_current_screen')) {
     119        $screen = get_current_screen();
     120        if ( 'wp_super_faq' == $screen->post_type ) {
     121            $title = 'Enter question here';
     122        }
     123        return $title;
    121124    }
    122     return $title;
    123125}
    124126add_filter( 'enter_title_here', 'wp_super_faq_custom_title_text' );
     
    126128// Add default content text
    127129function wp_super_faq_custom_content_text( $content ) {
    128     $screen = get_current_screen();
    129     if ( 'wp_super_faq' == $screen->post_type ) {
    130         $content = 'Enter answer here';
     130    if (function_exists ('get_current_screen')) {
     131        $screen = get_current_screen();
     132        if ( 'wp_super_faq' == $screen->post_type ) {
     133            $content = 'Enter answer here';
     134        }
     135        return $content;
    131136    }
    132     return $content;
    133137}
    134138add_filter( 'default_content', 'wp_super_faq_custom_content_text' );
     
    163167            $post_category_slug = $term->slug;
    164168            // Custom Loop
    165             $wp_super_faq_query = new WP_Query( "taxonomy=wp_super_faq_category&term=$term->slug&posts_per_page=-1" );
     169            $wp_super_faq_query = new WP_Query( "taxonomy=wp_super_faq_category&term=$term->slug&posts_per_page=-1&showposts=-1" );
    166170            // The Loop
    167171            while ($wp_super_faq_query->have_posts()) : $wp_super_faq_query->the_post();
     
    176180    } else {
    177181        if ( $show_specific_category ) {
    178             $wp_super_faq_query = new WP_Query( "taxonomy=wp_super_faq_category&term=$show_specific_category&posts_per_page=-1"  );
     182            $wp_super_faq_query = new WP_Query( "taxonomy=wp_super_faq_category&term=$show_specific_category&posts_per_page=-1&showposts=-1"  );
    179183        } else {
    180             $wp_super_faq_query = new WP_Query( array( 'post_type' => 'wp_super_faq', 'posts_per_page' => '-1', ) );
     184            $wp_super_faq_query = new WP_Query( 'post_type=wp_super_faq&posts_per_page=-1&showposts=-1' );
    181185        }
    182186       
Note: See TracChangeset for help on using the changeset viewer.