Filter each entry in “Validation logs” and register “Preset filters” for “Search in logs”.
Description
The filter hook “ip-location-block-logs” makes each entry in logs to be filtered. Also “ip-location-block-logs-preset” allows to resiger preset filters for search text box.
Parameters
ip-location-block-logs
- $logs
An array of validation logs that consist as follows:
ip-location-block-logs-preset
- $filters
An array of preset filters that consists oftitle
andvalue
.
Use case
The following code snippet in drop-in-admin.php
placed at the directory of Geolocation API library can add an UI to “Search in logs” corresponded to the filtered logs to make analysys of logs easy.
And here’s a sample of new UI “Preset filters”.
Note: In the above code snippet, some html entities such as
¹
are used. Not all the entities are available but some of those which are defined in ent2ncr() because all the text will be escaped by esc_html() before rendering. Since
0.3.0.15