WordPress.org

Ready to get started?Download WordPress

Forums

Q and A FAQ and Knowledge Base for WordPress
[Plugin: Q and A - FAQ Plugin] [Mini-bugs+fix] Undefined variable notices and translation issue (1 post)

  1. jrf
    Member
    Posted 1 year ago #

    Hiya,

    Thanks for your very nice plugin. As I test all plugins I use with WP_DEBUG before putting them live, I found some small bugs.
    Please find the fixes included.

    When activating the plugin and once it is activated, I get two undefined variable notices for the qa_version variable on every admin page.

    To fix these:
    File q-and-a.php, change line 182:

    function qa_init() {

    to:

    function qa_init() {
    	global $qa_version;

    On the re-order page, the dropdown has a undefined notice as well.
    To fix:
    File reorder.php, change line 79:
    echo '<option value='. $term->term_id, $_GET[$tax_slug] == $term->term_id ? ' selected="selected"' : '','>' . $term->name .' (' . $term->count .')</option>';
    to:
    echo '<option value='. $term->term_id, ( ( isset( $_GET[$tax_slug] ) && $_GET[$tax_slug] == $term->term_id ) ? ' selected="selected"' : '' ),'>' . $term->name .' (' . $term->count .')</option>';

    Similar issue again on the faq page dropdown, to fix:
    File q-and-a.php, change line 80:
    echo '<option value='. $term->slug, $_GET[$tax_slug] == $term->slug ? ' selected="selected"' : '','>' . $term->name .' (' . $term->count .')</option>';
    to:
    echo '<option value='. $term->slug, ( ( isset( $_GET[$tax_slug] ) && $_GET[$tax_slug] == $term->slug ) ? ' selected="selected"' : '' ),'>' . $term->name .' (' . $term->count .')</option>';

    Encountered another notice when adding the search box, to fix:
    File q-and-a.php, change line 167:
    $qasearch_shortcode .= '<form role="search" method="get" id="searchform" action="';
    to:
    $qasearch_shortcode = '<form role="search" method="get" id="searchform" action="';

    Another 'bug' is that when displaying the searchbox, the text 'Search FAQ's' is added above the search box. This is confusing on non-English blogs. An option to translate this phrase would be very useful, alternatively, leave out this line and leave it up to the blog admin to add any text above/aside/below the search box.

    Hope this helps!

    Smile,
    Juliette

    http://wordpress.org/extend/plugins/q-and-a/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags