WP Hide Post - Version 1.1.1

Version Description

Download this release

Release Info

Developer rmahfoud
Plugin Icon wp plugin WP Hide Post
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1.0 to 1.1.1

Files changed (2) hide show
  1. readme.txt +2 -1
  2. wp-hide-post.php +3 -2
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://anappleaday.konceptus.net/donate
4
  Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
5
  Requires at least: 2.7.1
6
  Tested up to: 2.8.3
7
- Stable tag: 1.1.0
8
 
9
  Enables you to control the visibility of items on your blog by making posts/pages hidden on some parts of your blog, while still visible in other parts as well as to search engines. This plugin is the new incarnation of the 'WP low Profiler'. If this plugin already exists, it will be upgraded to this one, keeping all existing settings.
10
 
@@ -92,6 +92,7 @@ Ditto. It will be deleted. If you had any existing data (if you had it active be
92
 
93
  == Revision History ==
94
 
 
95
  * 08/04/2009: v1.1.0 - Bug fix: bulk update clears "Visibility Attributes". Split code into separate files.
96
  * 07/24/2009: v1.0.4 - Minor bug fixes
97
  * 07/24/2009: v1.0.3 - Initial public release of 'WP Hide Post' and deprecation of 'WP low Profiler'
4
  Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
5
  Requires at least: 2.7.1
6
  Tested up to: 2.8.3
7
+ Stable tag: 1.1.1
8
 
9
  Enables you to control the visibility of items on your blog by making posts/pages hidden on some parts of your blog, while still visible in other parts as well as to search engines. This plugin is the new incarnation of the 'WP low Profiler'. If this plugin already exists, it will be upgraded to this one, keeping all existing settings.
10
 
92
 
93
  == Revision History ==
94
 
95
+ * 08/05/2009: v1.1.1 - Reduce the number of SQL queries to hide pages to a single queries for all pages, rather than one query per page.
96
  * 08/04/2009: v1.1.0 - Bug fix: bulk update clears "Visibility Attributes". Split code into separate files.
97
  * 07/24/2009: v1.0.4 - Minor bug fixes
98
  * 07/24/2009: v1.0.3 - Initial public release of 'WP Hide Post' and deprecation of 'WP low Profiler'
wp-hide-post.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Hide Post
4
  Plugin URI: http://anappleaday.konceptus.net/posts/wp-hide-post/
5
  Description: Enables a user to control the visibility of items on the blog by making posts and pages selectively hidden in different views throughout the blog, such as on the front page, category pages, search results, etc... The hidden item remains otherwise accessible directly using permalinks, and also visible to search engines as part of the sitemap (at least). This plugin enables new SEO possibilities for authors since it enables them to create new posts and pages without being forced to display them on their front and in feeds.
6
- Version: 1.1.0
7
  Author: Robert Mahfoud
8
  Author URI: http://anappleaday.konceptus.net
9
  Text Domain: wp_hide_post
@@ -158,8 +158,9 @@ function wphp_exclude_low_profile_items($item_type, $posts) {
158
  global $wpdb;
159
  // now loop over the pages, and exclude the ones with low profile in this context
160
  $result = array();
 
161
  foreach($posts as $post) {
162
- $check = strval($wpdb->get_var("SELECT meta_value FROM ".WPHP_TABLE_NAME." WHERE post_id = $post->ID and meta_key = '_wplp_page_flags'"));
163
  if( ($check == 'front' && wphp_is_front_page()) || $check == 'all') {
164
  // exclude page
165
  } else
3
  Plugin Name: WP Hide Post
4
  Plugin URI: http://anappleaday.konceptus.net/posts/wp-hide-post/
5
  Description: Enables a user to control the visibility of items on the blog by making posts and pages selectively hidden in different views throughout the blog, such as on the front page, category pages, search results, etc... The hidden item remains otherwise accessible directly using permalinks, and also visible to search engines as part of the sitemap (at least). This plugin enables new SEO possibilities for authors since it enables them to create new posts and pages without being forced to display them on their front and in feeds.
6
+ Version: 1.1.1
7
  Author: Robert Mahfoud
8
  Author URI: http://anappleaday.konceptus.net
9
  Text Domain: wp_hide_post
158
  global $wpdb;
159
  // now loop over the pages, and exclude the ones with low profile in this context
160
  $result = array();
161
+ $page_flags = $wpdb->get_results("SELECT post_id, meta_value FROM ".WPHP_TABLE_NAME." WHERE meta_key = '_wplp_page_flags'", OBJECT_K);
162
  foreach($posts as $post) {
163
+ $check = isset($page_flags[ $post->ID ]) ? $page_flags[ $post->ID ]->meta_value : null;
164
  if( ($check == 'front' && wphp_is_front_page()) || $check == 'all') {
165
  // exclude page
166
  } else