Hi,
I want to add a conditional to test if something is true and then display a post regardless of the “specific post conditions” already set. For example, if $x=123 then ignore specific post restrictions and display post – don’t redirect to Options Page.
I think I need to modify or filter this …
ws_plugin__s2member_before_check_specific_post_level_access
I’ve set up mu-plugins/s2-hack.php and have the following template but I don’t know how to structure the hook or filter.
<?php
add_filter("filter_name", "my_filtering_function");
function my_filtering_function($original_value, $vars = array())
{
if($original_value !== "something I like")
return ($my_custom_value = "My Filter works.");
else # Return original value.
return $original_value;
# Optional. s2Member® passes you an array of defined variables.
# print_r($vars); # Would give you a list of defined variables.
# These are PHP variables defined within the scope of the Filter,
# at the precise point in which the Filter is fired by s2Member®.
# $vars["__refs"] are also included (with some Filters).
# These are internal PHP variable references (very useful).
# To learn all about references, please see PHP documentation:
# http://www.php.net/manual/en/language.references.pass.php
}
?>
Can you please provide an example?
Thanks,
Steinar