Added the database path to the integration page for documentation purposes
This commit is contained in:
parent
b577b8a386
commit
0f18570827
|
@ -75,6 +75,35 @@ class WC_Integration_MaxMind_Geolocation extends WC_Integration {
|
|||
add_filter( 'woocommerce_geolocate_ip', array( $this, 'geolocate_ip' ), 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the normal options so we can print the database file path to the admin,
|
||||
*/
|
||||
public function admin_options() {
|
||||
parent::admin_options();
|
||||
|
||||
$database_path = esc_attr( $this->database_service->get_database_path() );
|
||||
$label = esc_html__( 'Database File Path', 'woocommerce' );
|
||||
$description = esc_html__( 'The path to the MaxMind database file that was downloaded by the integration.', 'woocommerce' );
|
||||
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo <<<INPUT
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th scope="row" class="titledesc">
|
||||
<label>{$label}</label>
|
||||
</th>
|
||||
<td class="forminp">
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text"><span>{$label}</span></legend>
|
||||
<input class="input-text regular-input" type="text" value="{$database_path}" readonly>
|
||||
<p class="description">{$description}</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
INPUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the settings fields.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue