I'm trying to write a plugin in wordpress to change an if phrase in wp-includes/comment.php. In PHP you can't override functions unfortunately, but is there any way I can get wordpress to use my phrase instead of the (almost identical) original phrase in comment.php?
I want comments that don't pass the block list to be moved to spam. Normally the comments are moved to trash. This can be solved in comment.php (l. 837):
Original: $approved = EMPTY_TRASH_DAYS ? 'trash' : 'spam';
Modified: $approved = 'spam';
Now I want to put this in an extra plugin to not change the wordpress core itself, but don't know hot to solve this
source https://stackoverflow.com/questions/70611473/overwrite-an-existing-phrase-in-wordpress
Comments
Post a Comment