Noptin_New_Post_Notify::schedule_notification( $post, $automation )
Notifies subscribers of a new post
Source Source
File: includes/class-noptin-new-post-notify.php
public function schedule_notification( $post, $automation ) { $sends_after = (int) get_post_meta( $automation->ID, 'noptin_sends_after', true ); $sends_after_unit = get_post_meta( $automation->ID, 'noptin_sends_after_unit', true ); if ( ! empty( $sends_after ) ) { $sends_after_unit = empty( $sends_after_unit ) ? 'minutes' : $sends_after_unit; $timestamp = strtotime( "+ $sends_after $sends_after_unit", current_time( 'timestamp', true ) ); return schedule_noptin_background_action( $timestamp, 'noptin_new_post_notification', $post->ID, $automation->ID ); } return do_noptin_background_action( 'noptin_new_post_notification', $post->ID, $automation->ID ); }
Expand full source code Collapse full source code View on GitHub