When creating the player, there was a need to collect auditions. I set up the collection and everything works.
You need to manually enter the data that is already available.
I added the following code to functions.php file:
/**
* ------------------------------------------------------------------------------------------------
* Адмінка статистики
* ------------------------------------------------------------------------------------------------
*/
function theasmart_add_admin_page() {
add_menu_page(
'Аналітика прослуховувань', // Заголовок сторінки
'Аналітика казок', // Назва в меню
'manage_options', // Права доступу
'theasmart-audio-analytics', // Слаг сторінки
'theasmart_render_admin_page', // Функція рендеру
'dashicons-chart-bar', // Іконка
20 // Позиція в меню
);
}
add_action('admin_menu', 'theasmart_add_admin_page');
function theasmart_render_admin_page() {
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'analytics'; // Визначаємо активну вкладку
?>
<div class="wrap">
<h1>