Last active
September 19, 2018 18:22
-
-
Save scottopolis/bd55d1216296d530aa0bec086a9c3268 to your computer and use it in GitHub Desktop.
AppCommunity Action Hook Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add this code to a plugin to modify a response | |
add_action('appcommunity_activity_get_item', function( $item, $retval, $request ) { | |
$retvalhasbadwords = false; | |
// check for bad words here... | |
if( $retvalhasbadwords ) { | |
// check response for bad words, and maybe send an admin email | |
wp_mail( get_option('admin_email'), "Bad words in activity", "Check out the recent activity from " . $request['user_id'] ); | |
} | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment