Last active
August 29, 2015 14:09
-
-
Save frankiejarrett/12bd7b39b3efdd6d905e to your computer and use it in GitHub Desktop.
Stream record array filter example for John Sundberg
This file contains hidden or 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 | |
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