Last active
January 28, 2017 02:42
-
-
Save butlerblog/eaaa82e79014c91ed5729a4449f3d579 to your computer and use it in GitHub Desktop.
blocking filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // ignore this line | |
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wpmem_regchk', 'my_regchk' ); | |
function my_regchk( $wpmem_regchk ) { | |
/** | |
* you can programmatically test for criteria and | |
* change the value of wpmem_regchk and return | |
* filtered value. | |
*/ | |
return $wpmem_regchk; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // ignore this line. | |
add_filter( 'wpmem_securify', 'my_securify_filter' ); | |
function my_securify_filter( $content ) { | |
/* | |
* This filter can filter the content that is returned. | |
* | |
* If you have additional criteria you want to set to | |
* block content, such as a custom post type, or a user | |
* level, this is the filter you want to use. | |
*/ | |
return $content; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // ignore this line | |
add_filter( 'wpmem_settings', 'my_wpmem_settings' ); | |
function my_wpmem_settings( $settings ) { | |
// Change values in the $settings array as needed. | |
return $settings; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example of wpmem_settings array contents. | |
Array | |
( | |
[version] => 3.1.7.a.1 | |
[notify] => 0 | |
[mod_reg] => 1 | |
[captcha] => 0 | |
[use_exp] => 1 | |
[use_trial] => 0 | |
[warnings] => 0 | |
[user_pages] => Array | |
( | |
[profile] => | |
[register] => | |
[login] => | |
) | |
[cssurl] => http://yoursite.com/wp-content/plugins/wp-members/css/generic-no-float.css | |
[style] => http://yoursite.com/wp-content/plugins/wp-members/css/generic-no-float.css | |
[attrib] => 0 | |
[post_types] => Array | |
( | |
) | |
[form_tags] => Array | |
( | |
[default] => Registration Default | |
) | |
[email] => Array | |
( | |
[from] => | |
[from_name] => | |
) | |
[block] => Array | |
( | |
[post] => 1 | |
[page] => 0 | |
) | |
[show_excerpt] => Array | |
( | |
[post] => 0 | |
[page] => 0 | |
) | |
[show_login] => Array | |
( | |
[post] => 1 | |
[page] => 1 | |
) | |
[show_reg] => Array | |
( | |
[post] => 1 | |
[page] => 1 | |
) | |
[autoex] => Array | |
( | |
[post] => Array | |
( | |
[enabled] => 0 | |
[length] => 0 | |
[text] => | |
) | |
[page] => Array | |
( | |
[enabled] => 0 | |
[length] => 0 | |
[text] => | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment