xwp / stream

🗄️ Stream plugin for WordPress
https://wordpress.org/plugins/stream/
GNU General Public License v2.0
411 stars 116 forks source link

Exclude Action Scheduler post and comment types #1002

Open lkraav opened 5 years ago

lkraav commented 5 years ago

Now that AS is part of WooCommerce, its usage surface rises rapidly.

This machine processing posts are all getting logged by Stream, highly likely creating a huge amount of noise.

I would propose to exclude them from processing as the shipped default.

add_filter( 'wp_stream_posts_exclude_post_types', function( $post_types ) {
        $post_types[] = 'scheduled-action';

        return $post_types;
} );

add_filter( 'wp_stream_comments_exclude_comment_types', function( $comment_types ) {
        $comment_types[] = 'action_log';

        return $comment_types;
} );

Your thoughts @lukecarbis?

lkraav commented 4 years ago

I would still do this @kasparsd :point_up: Action Scheduler files a ton of utility comments

kasparsd commented 4 years ago

Sounds good to me @lkraav! Is there an existing place to add these? Could we check for the presence of AS before adding these filters just to make sure we're not excluding some custom post types with the same name?