I need to create a group of words, to be defined in a textarea, in the admin panel of Wordpress, in a page of configuration of my plugin.
I have the following code:
add_filter('pre_comment_content', 'palavras_indesejadas');
function palavras_indesejadas($content {
//$palavras = get_comment_text();
$palavras = array('teste', 'testando');
foreach($palavras as $palavra) {
$content = str_replace($palavra, "******", $content);
}
return $content;
}
It will identify in this array which words I define, but I do not know how to create a table or field in the database so I can save these words and then the plugin can search for them in the database.
As for the configuration page, I know more or less how to create it, I'm just in doubt about how to save this information in the database and bring it into my array.