Skip to content

Instantly share code, notes, and snippets.

@fjarrett
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fjarrett/12bd7b39b3efdd6d905e to your computer and use it in GitHub Desktop.
Save fjarrett/12bd7b39b3efdd6d905e to your computer and use it in GitHub Desktop.
Stream record array filter example for John Sundberg
<?php
function bhww_filter_wp_stream_record_array( $recordarr ) {
if ( ! isset( $recordarr[0] ) ) {
return array();
}
// BackupBuddy (iThemes) entries
if (
'settings' === $recordarr[0]['connector']
&&
isset( $recordarr[0]['stream_meta']['option'] )
&&
'ithemes-updater-cache' === $recordarr[0]['stream_meta']['option']
) {
return array();
}
// WP Help entries
if (
'wp-help' === $recordarr[0]['context']
&&
isset( $recordarr[0]['stream_meta']['singular_name'] )
&&
'help document' === $recordarr[0]['stream_meta']['singular_name']
) {
return array();
}
// All other entries
return $recordarr;
}
add_filter( 'wp_stream_record_array', 'bhww_filter_wp_stream_record_array', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment