Statistics: Posted by Eduan — October 10th, 2011, 2:29 pm
function ASH_expiry_func( $atts ) {
$ts=get_user_field ("s2member_auto_eot_time");//EOT set manually
if(!$ts){
$ts=get_user_field(s2member_last_payment_time);//user paid by PayPal
if(current_user_can('administrator')){//admin will have no $ts
return 'n/a';
} else{
$eot=new DateTime("@$ts");
$eot->modify('+1 year');
}
} else {
$eot = date_create("@$ts");
}
return $eot->format('Y-m-d');
}
add_shortcode( 'ASH_expiry', 'ASH_expiry_func' );
Statistics: Posted by halifaxious — October 10th, 2011, 10:04 am