Closed bonny closed 3 months ago
The format has changed, so the inner query can be modified with a new filter:
// Modify query so it returns nothing.
add_filter('simple_history/log_query_inner_where_array', function($inner_where, $args) {
$inner_where[] = "1 = 0";
return $inner_where;
}, 10, 2);
Nice, thank you, working ok!
add_filter( 'simple_history/log_query_inner_where_array', function( $inner_where, $args ) {
$simple_history = \Simple_History\Simple_History::get_instance();
$contexts_table_name = $simple_history->get_contexts_table_name();
$inner_where[] = sprintf(
'id IN ( SELECT history_id FROM %1$s AS c WHERE c.key = "_user_id" AND c.value != "%2$s" )',
$contexts_table_name,
1
);
$inner_where[] = sprintf(
'id IN ( SELECT history_id FROM %1$s AS c WHERE c.key = "post_type" AND c.value IN ("%2$s") )',
$contexts_table_name,
implode( '","', array( 'post', 'page', 'event' ) )
);
return $inner_where;
}, 10, 2 );
This was probably removed when doing the big sql query rewrite https://github.com/bonny/WordPress-Simple-History/issues/409
Related: #341