Custom display_on
Pablo dos Santos Gonçalves Pacheco edited this page Jul 4, 2018
·
7 revisions
If the current display_on options aren't enough for you, you can setup custom triggers where/when the notice should be displayed.
In order to do that you only need to create a custom name for your case and a callback using the filter "ttwpwpan_rule_{$condition}"
, like this:
'display_on' => array(
'custom_case' => array( 'some_parameter' => 'some_value' )
);
add_filter( "ttwpwpan_rule_" . "custom_case", function( $match = false, $conditions ){
if( $conditions['some_parameter'] == 'some_value' ){
$match = true;
}
return $match;
}, 10, 2 );