Changeset 182
- Timestamp:
- 01/10/05 15:58:44 (3 years ago)
- Files:
-
- mini-posts/trunk/mini-posts.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mini-posts/trunk/mini-posts.php
r181 r182 4 4 Plugin URI: http://doocy.net/mini-posts/ 5 5 Description: An approach to "asides", or small posts. Allows you to mark entries as "mini" posts and handle them differently than normal posts. <strong>Requires WordPress 1.5.</strong> 6 Version: 0. 26 Version: 0.4 7 7 Author: Morgan Doocy 8 8 Author URI: http://doocy.net/ … … 36 36 0.2 - Corrected load_plugin_textdomain() domain. 37 37 0.3 - Updated to accommodate WP pages. 38 0.4 - Updated to accommodate feeds; added option to filter mini posts from feeds. 38 39 39 40 */ … … 44 45 update_option('filter_mini_posts_from_loop', $_POST['filter_mini_posts_from_loop'] == 1 ? 1 : 0); 45 46 update_option('suppress_autop_on_mini_posts', $_POST['suppress_autop_on_mini_posts'] == 1 ? 1 : 0); 47 update_option('filter_mini_posts_from_feeds', $_POST['filter_mini_posts_from_feeds'] == 1 ? 1 : 0); 46 48 echo '<div class="updated"><p><strong>' . __('Options updated.', 'MiniPosts') . '</strong></p></div>'; 47 49 } … … 61 63 $ck_filter_mini_posts_from_loop = get_settings('filter_mini_posts_from_loop') == 1 ? 'checked="checked" ' : ''; 62 64 $ck_suppress_autop_on_mini_posts = get_settings('suppress_autop_on_mini_posts') == 1 ? 'checked="checked" ' : ''; 65 $ck_filter_mini_posts_from_feeds = get_settings('filter_mini_posts_from_feeds') == 1 ? 'checked="checked" ' : ''; 63 66 64 67 ?> … … 69 72 <tr valign="top"> 70 73 <th width="33%" scope="row"><?php _e('Show/hide:', 'MiniPost') ?></th> 71 <td><label for="filter_mini_posts_from_loop"><input type="checkbox" name="filter_mini_posts_from_loop" id="filter_mini_posts_from_loop" <?php echo $ck_filter_mini_posts_from_loop ?> value="1" /> <?php _e('Filter mini posts from the Loop', 'MiniPosts') ?></label></td> 74 <td> 75 <label for="filter_mini_posts_from_loop"><input type="checkbox" name="filter_mini_posts_from_loop" id="filter_mini_posts_from_loop" <?php echo $ck_filter_mini_posts_from_loop ?> value="1" /> <?php _e('Filter mini posts from the Loop', 'MiniPosts') ?></label><br /> 76 <label for="filter_mini_posts_from_feeds"><input type="checkbox" name="filter_mini_posts_from_feeds" id="filter_mini_posts_from_feeds" <?php echo $ck_filter_mini_posts_from_feeds ?> value="1" /> <?php _e('Filter mini posts from subscription feeds', 'MiniPosts') ?></label><br /> 77 </td> 72 78 </tr> 73 79 <tr valign="top"> … … 143 149 add_option('filter_mini_posts_from_loop', 1); 144 150 add_option('suppress_autop_on_mini_posts', 1); 151 add_option('filter_mini_posts_from_feeds', 0); 145 152 146 153 // Auto-install: If there are no previous meta values for '_mini_post', automatically add one for each post … … 240 247 global $wpdb, $pagenow; 241 248 242 if ( $pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !stristr($text, "wp_postmeta") && !is_page()) {249 if (!is_plugin_page() && $pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !is_single() && !is_archive() && !is_page() && (is_feed() && get_settings('filter_mini_posts_from_feeds') || !is_feed()) && !stristr($text, "wp_postmeta")) { 243 250 $text .= " LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)"; 244 251 } … … 250 257 global $user_ID, $user_level, $wpdb, $pagenow; 251 258 252 if (!is_plugin_page() && $pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !is_single() && !is_archive() && !is_page() ) {259 if (!is_plugin_page() && $pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !is_single() && !is_archive() && !is_page() && (is_feed() && get_settings('filter_mini_posts_from_feeds') || !is_feed())) { 253 260 $text .= " AND ($wpdb->postmeta.meta_key = '_mini_post' AND $wpdb->postmeta.meta_value = 0)"; 254 261 }
