I’m using following code to display a notification in the admin dashboard. I want to display only on the main dashboard page (index.php), however the following code would display on all pages in the dashboard. Is there anyway to restrict it only to the dashboard main page? Thanks.
function my_admin_notice() { ?>
<div class="updated">
<p><?php _e( 'some message', 'my-text-domain' ); ?></p>
</div>
<?php
}
add_action( 'admin_notices', 'my_admin_notice' );