0
I need to create a group of words, to be set in a textarea, in the admin panel of Wordpress, in a configuration page 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 what words I define, but I don’t know how to create a table or field in the database that 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 it creates, I’m just in doubt even how to save this information in the bank and bring it into my array.