Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (! wp_next_scheduled ( 'my_hourly_event' )) {
- wp_schedule_event(time(), 'hourly', 'my_hourly_event');
- }
- add_action('my_hourly_event', 'do_this_hourly');
- function do_this_hourly() {
- update_option('show_my_notification', true);
- }
- /**
- * Run This in Where in Your Notifications HTML
- */
- function show_my_notification() {
- if(get_option('show_my_notification')){
- // Put Your Notification HTML or Function
- update_option('show_my_notification', false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement