Site icon Hip-Hop Website Design and Development

wp_schedule_event not executing function call, even with add_action

I have looked at a lot of code and I just can not see why the function call is not being executed. Even my cron plugin manager, shows the event is there, but the function call is not listed.

Can someone see where I am going wrong? Mind you, in the cron manager, it shows the event but with no action associated with it. So I am not sure what is wrong with the add action

Here is the code:

function mmd_wpusercleanup_create_interval( $schedules ) 
{
   if(isset($schedules["MMD_cleanupevent"]))    // already set
      return $schedules;

    $schedules['MMD_cleanupevent'] = array(
        'interval' => 60,
        'display'  => __('Every 60 Seconds')
    );
    return $schedules;
}
add_filter( 'cron_schedules', 'mmd_wpusercleanup_create_interval' );


function mmd_wpusercleanup_StartProcessingKeepList($nBatch)
{
$args = array('nBatch' => $nBatch);

if (wp_next_scheduled('mmd_ProcessKeepBatch'))
   wp_clear_scheduled_hook( 'mmd_ProcessKeepBatch' );

 $Status = wp_schedule_event( current_time('timestamp'), 'MMD_cleanupevent', 'mmd_ProcessKeepBatch', array( $args ) );
 add_action( 'mmd_ProcessKeepBatch', 'mmd_wpusercleanup_ProcessKeepBatch' );    
}


// this is the call to make
function mmd_wpusercleanup_ProcessKeepBatch()
{
mmd_wpusercleanup_DebugLog('mmd_wpusercleanup_ProcessKeepBatch()');     
}


// THE IS WHAT STARTS THE EVENTS PROCESS BASED ON A USER CHOICE.  this code is not complete here.

function UseSelect()
{
  switch($DeleteType)
      {
       case 0: // Emails in file are to keep
       default:
         mmd_wpusercleanup_StartProcessingKeepList($nBatch);
       break;
       
       case 1: // Emails in file are to delete  
       break;
       
      }

 }  // if($bProcessDisplay==1)
}