WordPress Access Control - Version 4.0.12

Version Description

  • September 13, 2014 =

  • Fix PHP warning if there is no post

Download this release

Release Info

Developer brandon.wamboldt
Plugin Icon wp plugin WordPress Access Control
Version 4.0.12
Comparing to
See all releases

Code changes from version 4.0.11 to 4.0.12

Files changed (2) hide show
  1. readme.txt +5 -1
  2. wordpress-access-control.php +5 -3
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: members, only, plugin, restricted, access, menus, 3.3, wp_nav_menu, nonmembers
5
  Requires at least: 3.0
6
  Tested up to: 4.0
7
- Stable tag: 4.0.11
8
 
9
  Restrict pages, posts, custom post types, menus and widgets to members, nonmembers or specific roles and still add to navigation
10
 
@@ -64,6 +64,10 @@ Yes, this is a new feature in 3.1.3. Use the syntax [members role="administrator
64
 
65
  == Changelog ==
66
 
 
 
 
 
67
  = 4.0.11 - September 13, 2014 =
68
 
69
  * Add the ability to set the default state/roles for custom post types instead of just pages & posts
4
  Tags: members, only, plugin, restricted, access, menus, 3.3, wp_nav_menu, nonmembers
5
  Requires at least: 3.0
6
  Tested up to: 4.0
7
+ Stable tag: 4.0.12
8
 
9
  Restrict pages, posts, custom post types, menus and widgets to members, nonmembers or specific roles and still add to navigation
10
 
64
 
65
  == Changelog ==
66
 
67
+ = 4.0.12 - September 13, 2014 =
68
+
69
+ * Fix PHP warning if there is no post
70
+
71
  = 4.0.11 - September 13, 2014 =
72
 
73
  * Add the ability to set the default state/roles for custom post types instead of just pages & posts
wordpress-access-control.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://brandonwamboldt.ca/plugins/members-only-menu-plugin/
5
  * Author: Brandon Wamboldt
6
  * Author URI: http://brandonwamboldt.ca/
7
- * Version: 4.0.11
8
  * Description: This plugin is a powerful tool which gives you fine grained control over your pages and posts (and custom post types), allowing you to restrict a page, post, or custom post type to members, non-members, or even specific roles. You can customize how these pages and posts show up in search results, where users are directed when they visit them, and much more. <strong>You can even make your entire blog members only!</strong>.
9
  */
10
 
@@ -281,10 +281,12 @@ class WordPressAccessControl
281
 
282
  public static function check_for_nonmembers_only()
283
  {
284
- if (is_admin()) return;
285
-
286
  global $post;
287
 
 
 
 
 
288
  if (get_post_meta($post->ID, '_wpac_is_nonmembers_only', true) && !WordPressAccessControl::check_conditions($post->ID)) {
289
  $redirect_to = get_post_meta($post->ID, '_wpac_nonmembers_redirect_to', true);
290
 
4
  * Plugin URI: http://brandonwamboldt.ca/plugins/members-only-menu-plugin/
5
  * Author: Brandon Wamboldt
6
  * Author URI: http://brandonwamboldt.ca/
7
+ * Version: 4.0.12
8
  * Description: This plugin is a powerful tool which gives you fine grained control over your pages and posts (and custom post types), allowing you to restrict a page, post, or custom post type to members, non-members, or even specific roles. You can customize how these pages and posts show up in search results, where users are directed when they visit them, and much more. <strong>You can even make your entire blog members only!</strong>.
9
  */
10
 
281
 
282
  public static function check_for_nonmembers_only()
283
  {
 
 
284
  global $post;
285
 
286
+ if (is_admin() || !$post) {
287
+ return;
288
+ }
289
+
290
  if (get_post_meta($post->ID, '_wpac_is_nonmembers_only', true) && !WordPressAccessControl::check_conditions($post->ID)) {
291
  $redirect_to = get_post_meta($post->ID, '_wpac_nonmembers_redirect_to', true);
292