Files
wp-cycling-stats/includes/admin/hooks.php
T
2026-04-22 12:51:16 +02:00

27 lines
830 B
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Set up admin-specific hooks.
*/
function statpress_admin_init_setup() {
add_filter( 'upload_mimes', 'statpress_add_gpx_mime_type' );
add_filter( 'wp_check_filetype_and_ext', 'statpress_fix_gpx_upload_permission', 10, 4 );
statpress_register_settings();
}
/**
* Enqueue admin-specific CSS.
*
* @param string $hook The current admin page hook.
*/
function statpress_enqueue_admin_styles( $hook ) {
global $statpress_plugin_hooks;
if ( is_array( $statpress_plugin_hooks ) && in_array( $hook, $statpress_plugin_hooks, true ) ) {
$plugin_version = '1.0'; // You can use filemtime() for cache-busting in development
wp_enqueue_style( 'statpress-admin-styles', STATPRESS_PLUGIN_URL . 'assets/css/admin.css', array(), $plugin_version );
}
}