Hi @alexpr,
WordPress does not support “shortcode in shortcode” method of display, so you need a custom code for the purpose. You may place such in the functions.php file of your child theme to create your own shortcode.
1. Without using WP Date and Time Shortcode (you don’t need to have it installed):
// Add the shortcode with custom function without using [wpdts]
add_shortcode( 'denra-delta', 'denra_delta_no_wpdts' );
function denra_delta_no_wpdts ( $atts, $content='', $tag ) {
// Get the current timestamp with offset according to the WP timezone.
$ts_current = current_time( 'timestamp' );
// The number of days difference in seconds. 86400 sec = 1 day.
$ts_diff = intval( do_shortcode( '[acf field="delta"]' ) ) * 86400;
// The result timestamp.
$ts_res = $ts_current + $ts_diff;
// Return the date in the wanted format without [wpdts]
return date( 'Y-m-d H:i:s', $ts_res );
}
2. With using WP Date and Time Shortcode (you need to have it installed and active):
// Add the shortcode with custom function using [wpdts]
add_shortcode( 'denra-delta', 'denra_delta_wpdts' );
function denra_delta_wpdts ( $atts, $content='', $tag ) {
// The number of days difference from the ACF shortcode.
$days = intval( do_shortcode( '[acf field="delta"]' ) );
$days_attr = ( $days < 0 ) ? $days : '+' . $days;
// Return the date in the wanted format with [wpdts-custom]
return do_shortcode( '[wpdts-custom format="Y-m-d H:i:s" days="' . $days_attr . ' days"]' );
}
Then use [denra-delta] in your website content.
You may change the date format in the quotes (‘Y-m-d H:i:s’) as you wish using the symbols listed here:
https://www.php.net/manual/en/datetime.format.php
Please let me me know if that works for you.