Plugin Directory

Changeset 697067


Ignore:
Timestamp:
04/13/2013 07:59:01 PM (13 years ago)
Author:
doodlebee
Message:

Fix for WooThemes Canvas conflict

Location:
back-end-instructions/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • back-end-instructions/trunk/instructions.php

    r667479 r697067  
    55Description: Plugin to provide nice little instructions for back-end WordPress users
    66Author: Shelly Cole
    7 Version: 2.5.1
     7Version: 2.5.2
    88Author URI: http://brassblogs.com
    99License: GPLv2
     
    521521add_action('load-'.$pagenow, 'add_bei_instructions_button');
    522522function add_bei_instructions_button() {
    523     global $current_user, $user_level, $post, $pagenow, $endofurl, $class, $address, $pluginloc, $options;
     523    global $wpdb, $current_user, $user_level, $post, $pagenow, $endofurl, $class, $address, $pluginloc, $options;
    524524   
    525525    $screen = get_current_screen();
     
    531531   
    532532    $ids = array();                                                                         // set up array of ID's that fit
    533     $instruction_query = new WP_Query(array('post_type' => 'instructions', 'post_status' => 'publish' ) );      // query
    534    
    535     if($instruction_query->have_posts()) : while($instruction_query->have_posts()) : $instruction_query->the_post();
    536         $post_id = get_the_ID();
     533    // we must use a custom select query, and NOT us "setup_postdata", because the $post variable conflicts with other plugins
     534    $sql = "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE $wpdb->posts.post_type = 'instructions' AND $wpdb->posts.post_status = 'publish'";
     535    $instructions = $wpdb->get_results($sql, OBJECT);
     536    if( $instructions ) :
     537        foreach( $instructions as $ins ) :
     538        $post_id = $ins->ID;
    537539        $instruction_info = get_post_meta($post_id, 'instructions');
    538540        $page = $instruction_info[0]['page_id'];                                            // page this is supposed to be on
     
    540542        $ids[] = $post_id;
    541543
    542     endwhile;
     544    endforeach;
    543545    endif;
    544546
     
    549551            $instruction_info = $instruction_info[0];
    550552            $page = $instruction_info['page_id'];                                           // page for this instruction to be displayed on
    551             $multi = $instruction_info['multi'];                                            // secondary pages, if any (this will be an array)
     553            if(!empty($instruction_info['multi']))
     554                $multi = $instruction_info['multi'];                                            // secondary pages, if any (this will be an array)
    552555            $level = $instruction_info['user_level'];                                       // level that can see this instruction
    553556            $video = $instruction_info['video_url'];                                        // video url
  • back-end-instructions/trunk/readme.txt

    r667479 r697067  
    44Tags: developers, clients, instructions
    55Requires at least: 3.1
    6 Tested up to: 3.5
    7 Stable tag: 2.5.1
     6Tested up to: 3.5.1
     7Stable tag: 2.5.2
    88License: GPLv2 or later
    99
     
    147147== Changelog ==
    148148
     149= 2.5.2 =
     150* Bugfix: swapped a custom loop for a custom query to fix a reported conflict with a WooThemes theme.
     151
    149152= 2.5.1 =
    150153* Bugfix: missing variable.
Note: See TracChangeset for help on using the changeset viewer.