ID, 'use_schedule', true ); if($use_schedule=='') { $use_schedule=0; } $schedule = get_post_meta( $post->ID, 'schedule', true ); if($schedule!='') { $schedule_id = json_decode( $schedule, true ); if(is_array($schedule_id)) { $schedule_id = array_keys( $schedule_id ); $schedule_id = $schedule_id[0]; } } $start_date = get_post_meta( $schedule_id, 'start_date', true ); $end_date = get_post_meta( $schedule_id, 'end_date', true ); $max_clicks = get_post_meta( $schedule_id, 'max_clicks', true ); $max_impressions = get_post_meta( $schedule_id, 'max_impressions', true ); if ( $start_date == '' ) { $start_date = mktime( 0, 0, 0, date( 'n' ), date( 'd' ), date( 'Y' ) ); } if ( $end_date == '' ) { $end_date = $start_date + ( 30 * 24 * 60 * 60 ); } $start_date = date( 'Y-m-d H:i', $start_date ); $end_date = date( 'Y-m-d H:i', $end_date ); if ( $max_clicks == '' ) { $max_clicks = 0; } if ( $max_impressions == '' ) { $max_impressions = 0; } ?>
Use schedule for this advert />
From to
Maximum Clicks
Maximum Impressions

You can have one schedule with limited options for each advert in the free version of the plugin. Upgrade to Ad Manager WD Pro to add unlimited number of schedules with more comprehensive settings.