@@ -92,12 +92,16 @@ public function network_admin_menu() {
92
92
public function admin_enqueue_scripts ( $ hook ) {
93
93
if ( $ hook === $ this ->parent_id ) {
94
94
wp_enqueue_script ( 'top-ten-admin-js ' );
95
- wp_enqueue_style ( 'tptn- admin-ui- css ' , );
95
+ wp_enqueue_style ( 'top-ten- admin-css ' );
96
96
wp_localize_script (
97
97
'top-ten-admin-js ' ,
98
- 'tptn_admin_data ' ,
98
+ 'top_ten_admin_data ' ,
99
99
array (
100
- 'security ' => wp_create_nonce ( 'tptn-admin ' ),
100
+ 'ajax_url ' => admin_url ( 'admin-ajax.php ' ),
101
+ 'security ' => wp_create_nonce ( 'tptn-admin ' ),
102
+ 'confirm_message ' => esc_html__ ( 'Are you sure you want to clear the cache? ' , 'top-10 ' ),
103
+ 'fail_message ' => esc_html__ ( 'Failed to clear cache. Please try again. ' , 'top-10 ' ),
104
+ 'request_fail_message ' => esc_html__ ( 'Request failed: ' , 'top-10 ' ),
101
105
)
102
106
);
103
107
}
@@ -181,7 +185,12 @@ public function render_page() {
181
185
182
186
<h2 style="padding-left:0px"><?php esc_html_e ( 'Clear cache ' , 'top-10 ' ); ?> </h2>
183
187
<p>
184
- <input type="button" name="cache_clear" id="cache_clear" value="<?php esc_attr_e ( 'Clear cache ' , 'top-10 ' ); ?> " class="button button-secondary" onclick="return clearCache();" />
188
+ <?php
189
+ printf (
190
+ '<button type="button" name="tptn_cache_clear" class="button button-secondary tptn_cache_clear" aria-label="%1$s">%1$s</button> ' ,
191
+ esc_html__ ( 'Clear cache ' , 'top-10 ' )
192
+ );
193
+ ?>
185
194
</p>
186
195
<p class="description">
187
196
<?php esc_html_e ( 'Clear the Top 10 cache. This will also be cleared automatically when you save the settings page. ' , 'top-10 ' ); ?>
0 commit comments