Description

This filter hook allows you to change the block setting for content. The wpmem_block function determines if content should be blocked or not and passes a true|false boolean to the wpmem_securify function. If $block is true, content is blocked.  By default, wpmem_block 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.

Changelog

Introduced in 2.7.5

Source

wpmem_block is located in wp-members-core.php

Usage

add_filter( 'wpmem_block', 'my_block_function' );
function my_block_function( $block )
{
	/**
	 * The plugin tests for pages and posts
	 * to be blocked or unblocked based on 
	 * the plugin's settings, then tests for
	 * custom field overrides, then sends the
	 * $block value to the wpmem_block filter.
	 *
	 * You can return the value unchanged, or
	 * test for any number of criteria and
	 * return that result.
	 *
	 * The value comes in as a true/false
	 * boolean and you must return a true/false
	 * boolean.
 	 */
	
	return $block;
}

Examples

See a list of all filter and action hooks

Private

You do not have permission to view this forum.