wpmem_block

Description

This filter hook allows you to change the block setting for content. The is_blocked() function determines if content should be blocked or not and passes a true|false boolean to the securify function. If $block is true, content is blocked.  By default, is_blocked tests for posts and pages, but any criteria could be tested in a custom filter function for blocking categories, tags, custom post types, etc.

Parameters

$block
(boolean)(required) A boolean to determine if content should be blocked or not.

$args
(array) (optional) An array of data used in the is_blocked() function.

  • post_id – the post ID
  • post_type – the post type
  • block – the block value (1 = blocked, 0 = unblocked, 2 = hidden)
  • block_meta – “_wpmem_block”
  • block_type – the default value in settings for this post type

Usage

[gist id=eaaa82e79014c91ed5729a4449f3d579 file=wpmem_block.php]

Changelog

  • Introduced in 2.7.5
  • Moved to is_blocked() in WP_Members object in 3.0.0

Source

wpmem_block is located in includes/class-wp-members.php

Code Snippet Library [Subscriber Content]