The prowp_profanity_filter() function will replace the words “sissy” and “dummy”
with [censored] automatically on all posts and pages on your website. You are using the str_ireplace() PHP function to handle the replacement. This function will replace some characters in a string with other characters in a string. The str_ireplace() function is also case-insensitive. Because you are using a Filter hook, the content isn’t actually modifi ed in the database; instead, it’s modifi ed during processing of the_post(), before being displayed, when this fi lter is invoked. The content in the database is not affected so the words “sissy” and “dummy” will still exist in your content, and if you ever disable or change the plugin, those words will appear in the displayed text. Filter hooks always receive data; in this case, the $content variable is passed to your function and contains your post content. Also notice the last line of your function returns the $content variable. Remember that you must always return the content you are modifying or else it returns empty and therefore displays nothing. Now that you’ve seen the Filter hook in action, take a look at the Action hook and what it can do. The prowp_profanity_filter() function will replace the words “sissy” and “dummy”
Cursurile noastre
Cum privesc o opera de arta? – istoria artei
Sunt explorator – geografie
De ce? – stinte
Cursuri pentru tutori /educatori
Proiecte