Example code for more than one extra rule
-
Could you please add on to your example of the filter so that it shows how to create more than one additional rule? Does it require another function, or can another rule be added within the my_wpmdb_anonymization_rules function? The $config is throwing me off since it’s used so much elsewhere in the plugin and i’m novice at PHP.
<?php
/**
* Anonymizes a users date of birth.
*
* @param array $config
*
* @return array
*/
function my_wpmdb_anonymization_rules( $config ) {
$config[‘usermeta’][‘meta_value’][] = array(
‘constraint’ => array( ‘meta_key’ => ‘dob’ ),
‘fake_data_type’ => ‘dateTimeThisCentury’,
);return $config;
}add_filter( ‘wpmdb_anonymization_config’, ‘my_wpmdb_anonymization_rules’ );
?>
The topic ‘Example code for more than one extra rule’ is closed to new replies.