Ah sorry, I’ve missed this question. Strange, I should get notifications though. Anyway, there is a filter for this: dn_mp3_url
So with
add_filter( 'dn_mp3_url', 'change_notification_sound' );
change_notification_sound( $mp3_url ) {
return 'http://example.com/other-sound.mp3';
}
you should be able to change the sound file.
I hope this helps,
David.
Hello Author,
I’m not a tech guy and i’m just starting learning wordpress.
Where to add this code? I need your help on this please. Sorry to bother you.
Thank you.
Hi renardv,
no problem. You will find in your theme files a functions.php. This would be an appropriate place. For example, if your theme is twentysixteen, you will find the file here:
wp-content/themes/twentysixteen/functions.php
> i’m just starting learning wordpress.
If you want to do such changes, it would be a good idea to use a child theme, so you can keep updating the theme without loosing such changes. More information about child themes: https://codex.ww.wp.xz.cn/Child_Themes
I hope, this helps 🙂
David.
Hello, @websupporter. Thanks for making this theme. It is working well.
However, I, too, would like to disable the sound for the desktop notification.
I tried adding the following code to my theme’s functions.php:
add_filter( 'dn_mp3_url', 'change_notification_sound' );
change_notification_sound( $mp3_url ) {
return '';
}
and
add_filter( 'dn_mp3_url', 'change_notification_sound' );
change_notification_sound( $mp3_url ) {
return NULL;
}
However, both of those completely broke the site. I had to go in my FTP and delete that from the file.
What might I be doing wrong, and what would you recommend I do to disable the sound for my desktop notifications?