WP Hide Post - Version 1.2.2

Version Description

Download this release

Release Info

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

Code changes from version 1.1.9 to 1.2.2

Files changed (5) hide show
  1. readme.txt +15 -15
  2. upgrade.php +4 -4
  3. wp-hide-post-api.php +21 -0
  4. wp-hide-post.php +46 -44
  5. wp-hide-post.pot +2 -2
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP Hide Post ===
2
- Contributors: rmahfoud
3
- Donate link: http://anappleaday.konceptus.net/donate
4
  Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
5
  Requires at least: 2.6
6
- Tested up to: 2.9
7
- Stable tag: 1.1.9
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
 
@@ -33,7 +33,7 @@ This means, technically, whenever pages are listed somewhere using the `get_page
33
 
34
  "WP Hide Post" plugin is a great tool in your arsenal for SEO optimization. It allows you to add plenty of content to your blog, without forcing you to change the nature and presentation of your front page, for example. You can now create content that you otherwise would be reluctant to add to your blog because it would show immediately on the front page, or somewhere else where it would not belong. It's a must-have feature of WordPress.
35
 
36
- Please enjoy this plugin freely, comment and rate it profusely, and send me feedback and any ideas for new features.
37
 
38
  == Installation ==
39
 
@@ -57,15 +57,15 @@ Yes. The *hidden* flags are just another set of attributes of a post/page. They
57
 
58
  = I have an idea to improve this feature further, what can I do? =
59
 
60
- Please contact me on my blog [An Apple a Day](http://anappleaday.konceptus.net/posts/wp-hide-post/). I'm looking forward to hearing any suggestions.
61
 
62
  = I just found something that doesn't look right, do I just sit on it? =
63
 
64
- By all means no! Please report any bugs on my blog [An Apple a Day](http://anappleaday.konceptus.net/posts/wp-hide-post/). I'd really appreciate it. This is free software and I rely on the help of people like you to maintain it.
65
 
66
  = I'm worried this could reduce my search engine ranking. Is it gonna? =
67
 
68
- Not at all. On the contrary. All the content you include on your blog, even though it's not directly accessible from the homepage for example, it's still to be available when search engines crawl your site, and will remain linkable for those individuals that are interested in it. Furthermore, if you use some sitemap generation plugin (like the [Google XML Sitemaps](http://wordpress.org/extend/plugins/google-sitemap-generator/) plugin I use on my own [blog](http://anappleaday.konceptus.net/)) all the content will be published to web crawlers and will be picked up by search engines. In fact, this plugin will make your SEO more effective by allowing you to add content that you wouldn't otherwise want to show on your homepage.
69
 
70
  = I used the 'WP low Profiler' plugin before. This one sounds just like it. =
71
 
@@ -85,14 +85,14 @@ Ditto. It will be deleted. If you had any existing data (if you had it active be
85
 
86
  == Screenshots ==
87
 
88
- 1. Closup showing the *Visibility Attributes* for posts. [See Larger Version](http://anappleaday.konceptus.net/wp-content/uploads/screenshot-11.png)
89
- 2. A small panel will appear whenever you are editing or creating a **post**. You can check one or more of the *Visibility Attributes* as needed. [See Larger Version](http://anappleaday.konceptus.net/wp-content/uploads/screenshot-21.png)
90
- 3. Closup showing the *Visibility Attributes* for pages. [See Larger Version](http://anappleaday.konceptus.net/wp-content/uploads/screenshot-31.png)
91
- 4. Another panel will appear whenever you are editing or creating a new **page**. You can check one or more of the *Visibility Attributes* as needed. Note that options for pages are different from those of posts. [See Larger Version](http://anappleaday.konceptus.net/wp-content/uploads/screenshot-41.png)
92
 
93
  == Revision History ==
94
-
95
- * 01/02/2009: v1.1.9 - Compatibility with Wordpress 2.9
96
  * 10/24/2009: v1.1.4 - Added compatibility with Wordpress 2.8.5
97
  * 08/07/2009: v1.1.3 - Extended support for Wordpress 2.6
98
  * 08/07/2009: v1.1.2 - Bug fixes.
@@ -103,4 +103,4 @@ Ditto. It will be deleted. If you had any existing data (if you had it active be
103
 
104
  == Development Blog ==
105
 
106
- Please visit the plugin page at [An Apple a Day](http://anappleaday.konceptus.net/posts/wp-hide-post/), and feel free to leave feedback, bug reports and comments.
1
  === WP Hide Post ===
2
+ Contributors: scriptburn
3
+ Donate link: http://www.konceptus.net/donate
4
  Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
5
  Requires at least: 2.6
6
+ Tested up to: 4.2.2
7
+ Stable tag: 1.2.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
 
33
 
34
  "WP Hide Post" plugin is a great tool in your arsenal for SEO optimization. It allows you to add plenty of content to your blog, without forcing you to change the nature and presentation of your front page, for example. You can now create content that you otherwise would be reluctant to add to your blog because it would show immediately on the front page, or somewhere else where it would not belong. It's a must-have feature of WordPress.
35
 
36
+ Please enjoy this plugin freely, comment and rate it profusely, and send me feedback and any ideas for new features.
37
 
38
  == Installation ==
39
 
57
 
58
  = I have an idea to improve this feature further, what can I do? =
59
 
60
+ Please contact me on my blog [An Apple a Day](http://www.konceptus.net/wp-hide-post/). I'm looking forward to hearing any suggestions.
61
 
62
  = I just found something that doesn't look right, do I just sit on it? =
63
 
64
+ By all means no! Please report any bugs on my blog [An Apple a Day](http://www.konceptus.net/wp-hide-post/). I'd really appreciate it. This is free software and I rely on the help of people like you to maintain it.
65
 
66
  = I'm worried this could reduce my search engine ranking. Is it gonna? =
67
 
68
+ Not at all. On the contrary. All the content you include on your blog, even though it's not directly accessible from the homepage for example, it's still to be available when search engines crawl your site, and will remain linkable for those individuals that are interested in it. Furthermore, if you use some sitemap generation plugin (like the [Google XML Sitemaps](http://wordpress.org/extend/plugins/google-sitemap-generator/) plugin I use on my own [blog](http://www.konceptus.net/)) all the content will be published to web crawlers and will be picked up by search engines. In fact, this plugin will make your SEO more effective by allowing you to add content that you wouldn't otherwise want to show on your homepage.
69
 
70
  = I used the 'WP low Profiler' plugin before. This one sounds just like it. =
71
 
85
 
86
  == Screenshots ==
87
 
88
+ 1. Closup showing the *Visibility Attributes* for posts. [See Larger Version](http://www.konceptus.net/wp-content/uploads/screenshot-11.png)
89
+ 2. A small panel will appear whenever you are editing or creating a **post**. You can check one or more of the *Visibility Attributes* as needed. [See Larger Version](http://www.konceptus.net/wp-content/uploads/screenshot-21.png)
90
+ 3. Closup showing the *Visibility Attributes* for pages. [See Larger Version](http://www.konceptus.net/wp-content/uploads/screenshot-31.png)
91
+ 4. Another panel will appear whenever you are editing or creating a new **page**. You can check one or more of the *Visibility Attributes* as needed. Note that options for pages are different from those of posts. [See Larger Version](http://www.konceptus.net/wp-content/uploads/screenshot-41.png)
92
 
93
  == Revision History ==
94
+ * 07/16/2015: v1.1.9 - Compatibility with Wordpress 4.2.2
95
+ * 01/02/2010: v1.1.9 - Compatibility with Wordpress 2.9
96
  * 10/24/2009: v1.1.4 - Added compatibility with Wordpress 2.8.5
97
  * 08/07/2009: v1.1.3 - Extended support for Wordpress 2.6
98
  * 08/07/2009: v1.1.2 - Bug fixes.
103
 
104
  == Development Blog ==
105
 
106
+ Please visit the plugin page at [An Apple a Day](http://www.konceptus.net/wp-hide-post/), and feel free to leave feedback, bug reports and comments.
upgrade.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- /* Copyright 2009 Robert Mahfoud (email : robert.mahfoud@gmail.com)
3
 
4
  This program is free software; you can redistribute it and/or modify
5
  it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@
24
  */
25
  function wphp_migrate_db() {
26
  wphp_log("called: wphp_migrate_db");
27
- /* When I first released this plugin, I was young and crazy and didn't know about the postmeta table.
28
  * With time I became wiser and wiser and decided to migrate the implementation to rely on postmeta.
29
  * I hope it was not a bad idea...
30
  */
@@ -66,7 +66,7 @@ function wphp_migrate_db() {
66
 
67
 
68
  /**
69
- *
70
  * @return unknown_type
71
  */
72
  function wphp_remove_wp_low_profiler() {
@@ -83,7 +83,7 @@ function wphp_remove_wp_low_profiler() {
83
  delete_plugins($plugins, '');
84
  } else
85
  wphp_log("The 'WP low Profiler' plugin does not exist.");
86
-
87
  }
88
 
89
  ?>
1
  <?php
2
+ /* Copyright 2015 Scriptburn (email : support@scriptburn.com)
3
 
4
  This program is free software; you can redistribute it and/or modify
5
  it under the terms of the GNU General Public License as published by
24
  */
25
  function wphp_migrate_db() {
26
  wphp_log("called: wphp_migrate_db");
27
+ /* When I first released this plugin, I was young and crazy and didn't know about the postmeta table.
28
  * With time I became wiser and wiser and decided to migrate the implementation to rely on postmeta.
29
  * I hope it was not a bad idea...
30
  */
66
 
67
 
68
  /**
69
+ *
70
  * @return unknown_type
71
  */
72
  function wphp_remove_wp_low_profiler() {
83
  delete_plugins($plugins, '');
84
  } else
85
  wphp_log("The 'WP low Profiler' plugin does not exist.");
86
+
87
  }
88
 
89
  ?>
wp-hide-post-api.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Copyright 2015 scriptburn (email : support@scriptburn.com)
3
+
4
+ This program is free software; you can redistribute it and/or modify
5
+ it under the terms of the GNU General Public License as published by
6
+ the Free Software Foundation; either version 2 of the License, or
7
+ (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU General Public License for more details.
13
+
14
+ You should have received a copy of the GNU General Public License
15
+ along with this program; if not, write to the Free Software
16
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+ */
18
+
19
+ require_once('./wp-hide-post.php');
20
+
21
+ ?>
wp-hide-post.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  /*
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.9
7
- Author: Robert Mahfoud
8
- Author URI: http://anappleaday.konceptus.net
9
  Text Domain: wp_hide_post
10
  */
11
 
12
- /* Copyright 2009 Robert Mahfoud (email : robert.mahfoud@gmail.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ Text Domain: wp_hide_post
27
  */
28
 
29
  /**
30
- *
31
  * @return unknown_type
32
  */
33
  function wphp_init() {
@@ -43,7 +43,7 @@ function wphp_init() {
43
  wphp_init();
44
 
45
  /**
46
- *
47
  * @param $msg
48
  * @return unknown_type
49
  */
@@ -53,7 +53,7 @@ function wphp_log($msg) {
53
  }
54
 
55
  /**
56
- *
57
  * @return unknown_type
58
  */
59
  function wphp_is_front_page() {
@@ -61,7 +61,7 @@ function wphp_is_front_page() {
61
  }
62
 
63
  /**
64
- *
65
  * @return unknown_type
66
  */
67
  function wphp_is_feed() {
@@ -69,7 +69,7 @@ function wphp_is_feed() {
69
  }
70
 
71
  /**
72
- *
73
  * @return unknown_type
74
  */
75
  function wphp_is_category() {
@@ -77,7 +77,7 @@ function wphp_is_category() {
77
  }
78
 
79
  /**
80
- *
81
  * @return unknown_type
82
  */
83
  function wphp_is_tag() {
@@ -85,7 +85,7 @@ function wphp_is_tag() {
85
  }
86
 
87
  /**
88
- *
89
  * @return unknown_type
90
  */
91
  function wphp_is_author() {
@@ -93,7 +93,7 @@ function wphp_is_author() {
93
  }
94
 
95
  /**
96
- *
97
  * @return unknown_type
98
  */
99
  function wphp_is_archive() {
@@ -101,7 +101,7 @@ function wphp_is_archive() {
101
  }
102
 
103
  /**
104
- *
105
  * @return unknown_type
106
  */
107
  function wphp_is_search() {
@@ -109,7 +109,7 @@ function wphp_is_search() {
109
  }
110
 
111
  /**
112
- *
113
  * @param $item_type
114
  * @return unknown_type
115
  */
@@ -136,7 +136,7 @@ function wphp_textdomain() {
136
  add_action('init', 'wphp_textdomain');
137
 
138
  /**
139
- *
140
  * @param $item_type
141
  * @param $posts
142
  * @return unknown_type
@@ -165,7 +165,7 @@ function wphp_exclude_low_profile_items($item_type, $posts) {
165
  return $posts;
166
  }
167
  }
168
-
169
  /**
170
  * Hook function to filter out hidden pages (get_pages)
171
  * @param $posts
@@ -178,7 +178,7 @@ function wphp_exclude_low_profile_pages($posts) {
178
  add_filter('get_pages', 'wphp_exclude_low_profile_pages');
179
 
180
  /**
181
- *
182
  * @param $where
183
  * @return unknown_type
184
  */
@@ -194,7 +194,7 @@ function wphp_query_posts_where($where) {
194
  add_filter('posts_where_paged', 'wphp_query_posts_where');
195
 
196
  /**
197
- *
198
  * @param $join
199
  * @return unknown_type
200
  */
@@ -204,7 +204,7 @@ function wphp_query_posts_join($join) {
204
  if( !$join )
205
  $join = '';
206
  $join .= ' LEFT JOIN '.WPHP_TABLE_NAME.' wphptbl ON '.WP_POSTS_TABLE_NAME.'.ID = wphptbl.post_id and wphptbl.meta_key like \'_wplp_%\'';
207
- // filter posts
208
  $join .= ' AND (('.WP_POSTS_TABLE_NAME.'.post_type = \'post\' ';
209
  if( wphp_is_front_page() )
210
  $join .= ' AND wphptbl.meta_key = \'_wplp_post_front\' ';
@@ -222,14 +222,14 @@ function wphp_query_posts_join($join) {
222
  $join .= ' AND wphptbl.meta_key = \'_wplp_post_search\' ';
223
  else
224
  $join .= ' AND wphptbl.meta_key not like \'_wplp_%\' ';
225
- $join .= ')';
226
  // pages
227
  $join .= ' OR ('.WP_POSTS_TABLE_NAME.'.post_type = \'page\' AND wphptbl.meta_key <> \'_wplp_page_flags\'';
228
  if( wphp_is_search())
229
  $join .= ' AND wphptbl.meta_key = \'_wplp_page_search\' ';
230
  else
231
  $join .= ' AND wphptbl.meta_key not like \'_wplp_%\' ';
232
- $join .= '))';
233
  }
234
  //echo "\n<!-- WPHP: ".$join." -->\n";
235
  return $join;
@@ -249,7 +249,7 @@ add_filter('posts_join_paged', 'wphp_query_posts_join');
249
  function wphp_activate() {
250
  wphp_init();
251
  wphp_log("called: wphp_activate");
252
-
253
  require_once(dirname(__FILE__).'/upgrade.php');
254
  wphp_migrate_db();
255
  wphp_remove_wp_low_profiler();
@@ -273,12 +273,12 @@ function wphp_activate_lowprofiler() {
273
  $err2_cleanup = __("The downloaded files were cleaned-up and no further action is required.", 'wp-hide-post');
274
  $err3_return = __("Return to plugins page...", 'wp-hide-post');
275
  $return_url = admin_url('plugins.php');
276
-
277
  $html = <<<HTML
278
  ${err1_sorry}<br />${err2_cleanup}<br /><a href="${$return_url}">${err3_return}</a>
279
  <script language="javascript">window.alert("${msgbox}");</script>
280
  HTML;
281
- // show the error page with the message...
282
  wp_die($html, 'WP low Profiler Activation Not Allowed', array( 'response' => '200') );
283
  }
284
  add_action('activate_wp-low-profiler/wp-low-profiler.php', 'wphp_activate_lowprofiler' );
@@ -301,7 +301,7 @@ function plugin_install_action_links_wp_lowprofiler($action_links, $plugin) {
301
  add_filter('plugin_install_action_links', 'plugin_install_action_links_wp_lowprofiler', 10, 2);
302
 
303
  /**
304
- *
305
  * @param $id
306
  * @param $lp_flag
307
  * @param $lp_value
@@ -319,7 +319,7 @@ function wphp_update_visibility($id, $lp_flag, $lp_value) {
319
  }
320
 
321
  /**
322
- *
323
  * @param $item_type
324
  * @param $id
325
  * @param $lp_flag
@@ -333,7 +333,7 @@ function wphp_unset_low_profile($item_type, $id, $lp_flag) {
333
  }
334
 
335
  /**
336
- *
337
  * @param $item_type
338
  * @param $id
339
  * @param $lp_flag
@@ -342,7 +342,7 @@ function wphp_unset_low_profile($item_type, $id, $lp_flag) {
342
  */
343
  function wphp_set_low_profile($item_type, $id, $lp_flag, $lp_value) {
344
  wphp_log("called: wphp_set_low_profile");
345
- global $wpdb;
346
  // Ensure No Duplicates!
347
  $check = $wpdb->get_var("SELECT count(*) FROM ".WPHP_TABLE_NAME." WHERE post_id = $id AND meta_key='$lp_flag'");
348
  if(!$check) {
@@ -353,7 +353,7 @@ function wphp_set_low_profile($item_type, $id, $lp_flag, $lp_value) {
353
  }
354
 
355
  /**
356
- *
357
  * @return unknown_type
358
  */
359
  function wphp_add_post_edit_meta_box() {
@@ -366,18 +366,18 @@ function wphp_add_post_edit_meta_box() {
366
  add_meta_box('hidepostdivpost', __('Post Visibility', 'wp-hide-post'), 'wphp_metabox_post_edit', 'post');
367
  add_meta_box('hidepostdivpage', __('Page Visibility', 'wp-hide-post'), 'wphp_metabox_page_edit', 'page');
368
  }
369
-
370
  }
371
  add_action('admin_menu', 'wphp_add_post_edit_meta_box');
372
 
373
  /**
374
- *
375
  * @return unknown_type
376
  */
377
  function wphp_metabox_post_edit() {
378
  wphp_log("called: wphp_metabox_post_edit");
379
  global $wpdb;
380
-
381
  $id = isset($_GET['post']) ? intval($_GET['post']) : 0;
382
 
383
  $wplp_post_front = 0;
@@ -387,7 +387,7 @@ function wphp_metabox_post_edit() {
387
  $wplp_post_archive = 0;
388
  $wplp_post_search = 0;
389
  $wplp_post_feed = 0;
390
-
391
  if($id > 0) {
392
  $flags = $wpdb->get_results("SELECT meta_key from ".WPHP_TABLE_NAME." where post_id = $id and meta_key like '_wplp_%'", ARRAY_N);
393
  if( $flags ) {
@@ -396,7 +396,7 @@ function wphp_metabox_post_edit() {
396
  // remove the leading _
397
  $flag = substr($flag, 1, strlen($flag)-1);
398
  ${$flag} = 1;
399
- }
400
  }
401
  }
402
  ?>
@@ -421,26 +421,28 @@ function wphp_metabox_post_edit() {
421
  <label for="wplp_post_feed" class="selectit"><input type="checkbox" id="wplp_post_feed" name="wplp_post_feed" value="1"<?php checked($wplp_post_feed, 1); ?>/>&nbsp;<?php _e('Hide in feeds.', 'wp-hide-post'); ?></label>
422
  <input type="hidden" name="old_wplp_post_feed" value="<?php echo $wplp_post_feed; ?>"/>
423
  <br />
424
- <div style="float:right;font-size: xx-small;"><a href="http://anappleaday.konceptus.net/posts/wp-hide-post/#comments"><?php _e("Leave feedback and report bugs...", 'wp-hide-post'); ?></a></div>
425
  <br />
426
  <div style="float:right;font-size: xx-small;"><a href="http://wordpress.org/extend/plugins/wp-hide-post/"><?php _e("Give 'WP Hide Post' a good rating...", 'wp-hide-post'); ?></a></div>
427
  <br />
 
 
428
  <?php
429
  }
430
 
431
  /**
432
- *
433
  * @return unknown_type
434
  */
435
  function wphp_metabox_page_edit() {
436
  wphp_log("called: wphp_metabox_page_edit");
437
  global $wpdb;
438
-
439
  $id = isset($_GET['post']) ? intval($_GET['post']) : 0;
440
 
441
  $wplp_page = 'none';
442
  $wplp_page_search_show = 1;
443
-
444
  if($id > 0) {
445
  $flags = $wpdb->get_results("SELECT meta_value from ".WPHP_TABLE_NAME." where post_id = $id and meta_key = '_wplp_page_flags'", ARRAY_N);
446
  if( $flags )
@@ -465,11 +467,11 @@ function wphp_metabox_page_edit() {
465
  </div>
466
  </div>
467
  <br />
468
- <div style="float:right;clear:both;font-size:x-small;">* Will still show up in sitemap.xml if you generate one automatically. See <a href="http://anappleaday.konceptus.net/posts/wp-low-profiler/">details</a>.</div>
469
  <br />
470
  <br />
471
  <br />
472
- <div style="float:right;font-size: xx-small;"><a href="http://anappleaday.konceptus.net/posts/wp-hide-post/#comments"><?php _e("Leave feedback and report bugs...", 'wp-hide-post'); ?></a></div>
473
  <br />
474
  <div style="float:right;clear:both;font-size:xx-small;"><a href="http://wordpress.org/extend/plugins/wp-hide-post/"><?php _e("Give 'WP Hide Post' a good rating...", 'wp-hide-post'); ?></a></div>
475
  <br />
@@ -492,7 +494,7 @@ function wphp_metabox_page_edit() {
492
  }
493
 
494
  /**
495
- *
496
  * @param $id
497
  * @return unknown_type
498
  */
@@ -525,12 +527,12 @@ function wphp_save_post($id) {
525
  } else
526
  wphp_update_visibility($id, "_wplp_page_search", 0);
527
  }
528
- }
529
  }
530
  add_action('save_post', 'wphp_save_post');
531
 
532
  /**
533
- *
534
  * @param $post_id
535
  * @return unknown_type
536
  */
1
  <?php
2
  /*
3
  Plugin Name: WP Hide Post
4
+ Plugin URI: http://konceptus.net/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.2.2
7
+ Author: scriptburn.com
8
+ Author URI: http://www.scriptburn.com
9
  Text Domain: wp_hide_post
10
  */
11
 
12
+ /* Copyright 2015 Scriptburn (email : support@scriptburn.com)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
27
  */
28
 
29
  /**
30
+ *
31
  * @return unknown_type
32
  */
33
  function wphp_init() {
43
  wphp_init();
44
 
45
  /**
46
+ *
47
  * @param $msg
48
  * @return unknown_type
49
  */
53
  }
54
 
55
  /**
56
+ *
57
  * @return unknown_type
58
  */
59
  function wphp_is_front_page() {
61
  }
62
 
63
  /**
64
+ *
65
  * @return unknown_type
66
  */
67
  function wphp_is_feed() {
69
  }
70
 
71
  /**
72
+ *
73
  * @return unknown_type
74
  */
75
  function wphp_is_category() {
77
  }
78
 
79
  /**
80
+ *
81
  * @return unknown_type
82
  */
83
  function wphp_is_tag() {
85
  }
86
 
87
  /**
88
+ *
89
  * @return unknown_type
90
  */
91
  function wphp_is_author() {
93
  }
94
 
95
  /**
96
+ *
97
  * @return unknown_type
98
  */
99
  function wphp_is_archive() {
101
  }
102
 
103
  /**
104
+ *
105
  * @return unknown_type
106
  */
107
  function wphp_is_search() {
109
  }
110
 
111
  /**
112
+ *
113
  * @param $item_type
114
  * @return unknown_type
115
  */
136
  add_action('init', 'wphp_textdomain');
137
 
138
  /**
139
+ *
140
  * @param $item_type
141
  * @param $posts
142
  * @return unknown_type
165
  return $posts;
166
  }
167
  }
168
+
169
  /**
170
  * Hook function to filter out hidden pages (get_pages)
171
  * @param $posts
178
  add_filter('get_pages', 'wphp_exclude_low_profile_pages');
179
 
180
  /**
181
+ *
182
  * @param $where
183
  * @return unknown_type
184
  */
194
  add_filter('posts_where_paged', 'wphp_query_posts_where');
195
 
196
  /**
197
+ *
198
  * @param $join
199
  * @return unknown_type
200
  */
204
  if( !$join )
205
  $join = '';
206
  $join .= ' LEFT JOIN '.WPHP_TABLE_NAME.' wphptbl ON '.WP_POSTS_TABLE_NAME.'.ID = wphptbl.post_id and wphptbl.meta_key like \'_wplp_%\'';
207
+ // filter posts
208
  $join .= ' AND (('.WP_POSTS_TABLE_NAME.'.post_type = \'post\' ';
209
  if( wphp_is_front_page() )
210
  $join .= ' AND wphptbl.meta_key = \'_wplp_post_front\' ';
222
  $join .= ' AND wphptbl.meta_key = \'_wplp_post_search\' ';
223
  else
224
  $join .= ' AND wphptbl.meta_key not like \'_wplp_%\' ';
225
+ $join .= ')';
226
  // pages
227
  $join .= ' OR ('.WP_POSTS_TABLE_NAME.'.post_type = \'page\' AND wphptbl.meta_key <> \'_wplp_page_flags\'';
228
  if( wphp_is_search())
229
  $join .= ' AND wphptbl.meta_key = \'_wplp_page_search\' ';
230
  else
231
  $join .= ' AND wphptbl.meta_key not like \'_wplp_%\' ';
232
+ $join .= '))';
233
  }
234
  //echo "\n<!-- WPHP: ".$join." -->\n";
235
  return $join;
249
  function wphp_activate() {
250
  wphp_init();
251
  wphp_log("called: wphp_activate");
252
+
253
  require_once(dirname(__FILE__).'/upgrade.php');
254
  wphp_migrate_db();
255
  wphp_remove_wp_low_profiler();
273
  $err2_cleanup = __("The downloaded files were cleaned-up and no further action is required.", 'wp-hide-post');
274
  $err3_return = __("Return to plugins page...", 'wp-hide-post');
275
  $return_url = admin_url('plugins.php');
276
+
277
  $html = <<<HTML
278
  ${err1_sorry}<br />${err2_cleanup}<br /><a href="${$return_url}">${err3_return}</a>
279
  <script language="javascript">window.alert("${msgbox}");</script>
280
  HTML;
281
+ // show the error page with the message...
282
  wp_die($html, 'WP low Profiler Activation Not Allowed', array( 'response' => '200') );
283
  }
284
  add_action('activate_wp-low-profiler/wp-low-profiler.php', 'wphp_activate_lowprofiler' );
301
  add_filter('plugin_install_action_links', 'plugin_install_action_links_wp_lowprofiler', 10, 2);
302
 
303
  /**
304
+ *
305
  * @param $id
306
  * @param $lp_flag
307
  * @param $lp_value
319
  }
320
 
321
  /**
322
+ *
323
  * @param $item_type
324
  * @param $id
325
  * @param $lp_flag
333
  }
334
 
335
  /**
336
+ *
337
  * @param $item_type
338
  * @param $id
339
  * @param $lp_flag
342
  */
343
  function wphp_set_low_profile($item_type, $id, $lp_flag, $lp_value) {
344
  wphp_log("called: wphp_set_low_profile");
345
+ global $wpdb;
346
  // Ensure No Duplicates!
347
  $check = $wpdb->get_var("SELECT count(*) FROM ".WPHP_TABLE_NAME." WHERE post_id = $id AND meta_key='$lp_flag'");
348
  if(!$check) {
353
  }
354
 
355
  /**
356
+ *
357
  * @return unknown_type
358
  */
359
  function wphp_add_post_edit_meta_box() {
366
  add_meta_box('hidepostdivpost', __('Post Visibility', 'wp-hide-post'), 'wphp_metabox_post_edit', 'post');
367
  add_meta_box('hidepostdivpage', __('Page Visibility', 'wp-hide-post'), 'wphp_metabox_page_edit', 'page');
368
  }
369
+
370
  }
371
  add_action('admin_menu', 'wphp_add_post_edit_meta_box');
372
 
373
  /**
374
+ *
375
  * @return unknown_type
376
  */
377
  function wphp_metabox_post_edit() {
378
  wphp_log("called: wphp_metabox_post_edit");
379
  global $wpdb;
380
+
381
  $id = isset($_GET['post']) ? intval($_GET['post']) : 0;
382
 
383
  $wplp_post_front = 0;
387
  $wplp_post_archive = 0;
388
  $wplp_post_search = 0;
389
  $wplp_post_feed = 0;
390
+
391
  if($id > 0) {
392
  $flags = $wpdb->get_results("SELECT meta_key from ".WPHP_TABLE_NAME." where post_id = $id and meta_key like '_wplp_%'", ARRAY_N);
393
  if( $flags ) {
396
  // remove the leading _
397
  $flag = substr($flag, 1, strlen($flag)-1);
398
  ${$flag} = 1;
399
+ }
400
  }
401
  }
402
  ?>
421
  <label for="wplp_post_feed" class="selectit"><input type="checkbox" id="wplp_post_feed" name="wplp_post_feed" value="1"<?php checked($wplp_post_feed, 1); ?>/>&nbsp;<?php _e('Hide in feeds.', 'wp-hide-post'); ?></label>
422
  <input type="hidden" name="old_wplp_post_feed" value="<?php echo $wplp_post_feed; ?>"/>
423
  <br />
424
+ <div style="float:right;font-size: xx-small;"><a href="http://www.scriptburn.com/wp-hide-post/#comments"><?php _e("Leave feedback and report bugs...", 'wp-hide-post'); ?></a></div>
425
  <br />
426
  <div style="float:right;font-size: xx-small;"><a href="http://wordpress.org/extend/plugins/wp-hide-post/"><?php _e("Give 'WP Hide Post' a good rating...", 'wp-hide-post'); ?></a></div>
427
  <br />
428
+ <div style="float:right;font-size: xx-small;"><a href="http://konceptus.net/donate/"><?php _e("Donate...", 'wp-hide-post'); ?></a></div>
429
+ <br />
430
  <?php
431
  }
432
 
433
  /**
434
+ *
435
  * @return unknown_type
436
  */
437
  function wphp_metabox_page_edit() {
438
  wphp_log("called: wphp_metabox_page_edit");
439
  global $wpdb;
440
+
441
  $id = isset($_GET['post']) ? intval($_GET['post']) : 0;
442
 
443
  $wplp_page = 'none';
444
  $wplp_page_search_show = 1;
445
+
446
  if($id > 0) {
447
  $flags = $wpdb->get_results("SELECT meta_value from ".WPHP_TABLE_NAME." where post_id = $id and meta_key = '_wplp_page_flags'", ARRAY_N);
448
  if( $flags )
467
  </div>
468
  </div>
469
  <br />
470
+ <div style="float:right;clear:both;font-size:x-small;">* Will still show up in sitemap.xml if you generate one automatically. See <a href="http://www.scriptburn.com/wp-low-profiler/">details</a>.</div>
471
  <br />
472
  <br />
473
  <br />
474
+ <div style="float:right;font-size: xx-small;"><a href="http://www.scriptburn.com/posts/wp-hide-post/#comments"><?php _e("Leave feedback and report bugs...", 'wp-hide-post'); ?></a></div>
475
  <br />
476
  <div style="float:right;clear:both;font-size:xx-small;"><a href="http://wordpress.org/extend/plugins/wp-hide-post/"><?php _e("Give 'WP Hide Post' a good rating...", 'wp-hide-post'); ?></a></div>
477
  <br />
494
  }
495
 
496
  /**
497
+ *
498
  * @param $id
499
  * @return unknown_type
500
  */
527
  } else
528
  wphp_update_visibility($id, "_wplp_page_search", 0);
529
  }
530
+ }
531
  }
532
  add_action('save_post', 'wphp_save_post');
533
 
534
  /**
535
+ *
536
  * @param $post_id
537
  * @return unknown_type
538
  */
wp-hide-post.pot CHANGED
@@ -109,7 +109,7 @@ msgid "WP Hide Post"
109
  msgstr ""
110
 
111
  #. Plugin URI of an extension
112
- msgid "http://anappleaday.konceptus.net/posts/wp-hide-post/"
113
  msgstr ""
114
 
115
  #. Description of an extension
@@ -129,5 +129,5 @@ msgid "Robert Mahfoud"
129
  msgstr ""
130
 
131
  #. Author URI of an extension
132
- msgid "http://anappleaday.konceptus.net"
133
  msgstr ""
109
  msgstr ""
110
 
111
  #. Plugin URI of an extension
112
+ msgid "http://www.1apple1day.com/posts/wp-hide-post/"
113
  msgstr ""
114
 
115
  #. Description of an extension
129
  msgstr ""
130
 
131
  #. Author URI of an extension
132
+ msgid "http://www.1apple1day.com"
133
  msgstr ""