searchwp\statistics\log
Desde: 4.0.0
Tabla de contenidos
Controla si SearchWP registra esta búsqueda.
Parámetros
| Tipo | Parámetro | Predeterminado | Desde |
|---|---|---|---|
| Booleano | $enabled |
true (si la consulta de búsqueda no se ignora) |
4.0.0 |
| \SearchWP\Query | $query |
La consulta que se está ejecutando | 4.0.0 |
Ejemplos
All hooks should be added to your custom SearchWP Customizations Plugin.
Desactivar el registro de búsquedas para cualquier persona que haya iniciado sesión
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 | |
| // Disable SearchWP's logging of searches for anyone who is logged in. | |
| add_filter( 'searchwp\statistics\log', function( $enabled, $query ) { | |
| return ! is_user_logged_in(); | |
| }, 20, 2 ); |

