Changeset 697067
- Timestamp:
- 04/13/2013 07:59:01 PM (13 years ago)
- Location:
- back-end-instructions/trunk
- Files:
-
- 2 edited
-
instructions.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
back-end-instructions/trunk/instructions.php
r667479 r697067 5 5 Description: Plugin to provide nice little instructions for back-end WordPress users 6 6 Author: Shelly Cole 7 Version: 2.5. 17 Version: 2.5.2 8 8 Author URI: http://brassblogs.com 9 9 License: GPLv2 … … 521 521 add_action('load-'.$pagenow, 'add_bei_instructions_button'); 522 522 function 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; 524 524 525 525 $screen = get_current_screen(); … … 531 531 532 532 $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; 537 539 $instruction_info = get_post_meta($post_id, 'instructions'); 538 540 $page = $instruction_info[0]['page_id']; // page this is supposed to be on … … 540 542 $ids[] = $post_id; 541 543 542 end while;544 endforeach; 543 545 endif; 544 546 … … 549 551 $instruction_info = $instruction_info[0]; 550 552 $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) 552 555 $level = $instruction_info['user_level']; // level that can see this instruction 553 556 $video = $instruction_info['video_url']; // video url -
back-end-instructions/trunk/readme.txt
r667479 r697067 4 4 Tags: developers, clients, instructions 5 5 Requires at least: 3.1 6 Tested up to: 3.5 7 Stable tag: 2.5. 16 Tested up to: 3.5.1 7 Stable tag: 2.5.2 8 8 License: GPLv2 or later 9 9 … … 147 147 == Changelog == 148 148 149 = 2.5.2 = 150 * Bugfix: swapped a custom loop for a custom query to fix a reported conflict with a WooThemes theme. 151 149 152 = 2.5.1 = 150 153 * Bugfix: missing variable.
Note: See TracChangeset
for help on using the changeset viewer.