Open Mte90 opened 8 years ago
function web_push_notification( $title, $content, $url, $icon = '' ) {
if ( class_exists( 'WebPush_Main' ) ) {
if ( empty( $icon ) ) {
$icon_option = get_option( 'webpush_icon' );
if ( $icon_option === 'blog_icon' ) {
$icon = get_site_icon_url();
} elseif ( $icon_option !== 'blog_icon' && $icon_option !== '' && $icon_option !== 'post_icon' ) {
$icon = $icon_option;
}
}
WebPush_Main::sendNotification( $title, $content, $icon, $url, null );
}
}
I think that can go on the readme :-D
Will be amazing to have examples and not to look on the tests to understand how to create a new notification.