WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] "unblock" is true even when set to "false" or "0" (2 posts)

  1. CodeMonkey613
    Member
    Posted 1 year ago #

    I made an Advanced Custom Field entry for the 'unblock' field to easily switch between true/false. However, it doesn't matter what the setting is on the field (can be true, false, 0, 1) it always unblocks the post/page. I have to delete the custom variable altogether to make it block again.

    wp-members-core.php at line 338 doesn't make any sense. You would have to change it to something like this:

    $unblock_var = get_post_custom_values('unblock');

    if( WPMEM_BLOCK_POSTS == 1 && (!isset(unblock_var) || (isset($unblock_var) && ($unblock_var == "false" || $unblock_var == "0"))) ){ $block = true; }

    http://wordpress.org/extend/plugins/wp-members/

  2. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    There is a legacy reason for the way it is the way it is. It will probably accept a false value in the future, but for now, to do what you are trying to do, you should be able to set the value to ''.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.