wp_cron
operates on intervals and there is no interval that will hit exactly the first day and the 15th of every month.
You could run your wp-cron
job every day and check the date, similar to this but with a simple callback like:
cron_callback_wpse_113675() {
$date = date('d');
if ('01' == $date || '15' == $date) {
// run your function
}
}
Or, use wp_schedule_single_event
with a more complicated callback. Something like this:
function cron_callback_v2_wpse_113675() {
$date = date('d');
if (!wp_next_scheduled(cron_callback_v2_wpse_113675)) {
$date = ($date < 15) ? '15' : '01';
}
if ('01' == $date || '15' == $date) {
// run your function
switch ($date) {
case '01' :
wp_schedule_single_event( strtotime('+14 days',strtotime('first day of')), 'cron_callback_v2_wpse_113675' );
break;
case '15' :
wp_schedule_single_event( strtotime('first day of'), 'cron_callback_v2_wpse_113675' );
break;
}
}
}
Barely Completely untested. Possibly buggy. Caveat emptor. No refunds.