Skip to content

Instantly share code, notes, and snippets.

@scottopolis
Last active September 19, 2018 18:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
AppCommunity Action Hook Example
<?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