• Resolved egocefalo

    (@egocefalo)


    First of all, Thanks a lot for the plugin!

    We create and update many posts and media every day and we don’t have a use for these logs.

    I read on other topics about a filter on this new update, so after updating I checked the settings page but couldn’t find any new filter or info about it.

    How can I filter/disable these? Maybe a functions.php snippet or else?

    Thank you!

    Best regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Yakir Sitbon

    (@kingyes)

    It can be something like this:

    add_filter( 'aal_skip_insert_log', function( $should_skip_insert, $args ) {
    	if ( $should_skip_insert ) {
    		// Already skipped.
    		return $should_skip_insert;
    	}
    	
    	if ( empty( $args['object_type'] ) || 'Posts' !== $args['object_type'] ) {
    		// Not a post.
    		return $should_skip_insert;
    	}
    
    	$cpt_to_skip = 'attachment';
    
    	if ( ! empty( $args['object_subtype'] ) && $cpt_to_skip === $args['object_subtype'] ) {
    		$should_skip_insert = true;
    	}
    	
    	return $should_skip_insert;
    }, 10, 2 );
    
    • This reply was modified 11 months, 3 weeks ago by Yakir Sitbon.
    Thread Starter egocefalo

    (@egocefalo)

    Hi @kingyes

    I added the snippet as it is and creation, updating, deleting of posts, as well as uploading of media are still being logged. So I guess it’s just an example and I need to dig a bit.

    Thanks a lot for your help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable/filter posts and media logging’ is closed to new replies.