• I am very happy with the shortcodes, but I want to make a feature request.
    I now have a shortcode like this: [acf7db form_id='XX' start-date="22/12/2018" end-date="29/12/2018"] but I want it to be like this [acf7db form_id='XX' start-date=[LastFriday] end-date=[Today]"]

    So can you guys consider to allow nested shortcodes? Or even better, support relative dates instead hardcoded dates?

    • This topic was modified 6 years, 2 months ago by tsjippy.
    • This topic was modified 6 years, 2 months ago by tsjippy.
    • This topic was modified 6 years, 2 months ago by tsjippy.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter tsjippy

    (@tsjippy)

    so in the file “vsz_acf7_db_shortcode_display_front.php”

    this should be changed:

    $start_date = $arrInfo['start-date'];
    $end_date = $arrInfo['end-date'];

    to a relative thing like:

    $scval = do_shortcode('['.$start_date.']');
            if( $scval != '['.$start_date.']' ){
                $value = esc_attr( $scval );
            }
    Thread Starter tsjippy

    (@tsjippy)

    actually all you need to add is a few lines:

    if(!empty($start_date)){
    	$start_date = date("d/m/Y", strtotime($start_date));
    }
    if(!empty($end_date)){
    	$end_date = date("d/m/Y", strtotime($end_date));
    }

    right after

    $start_date = $arrInfo['start-date'];
    $end_date = $arrInfo['end-date'];

    In vsz_acf7_db_shortcode_display_front.php.

    you can then have a shortcode like this:
    [acf7db form_id='X' start-date="last Friday" end-date="09/02/2019"]

    • This reply was modified 6 years, 2 months ago by tsjippy.
    • This reply was modified 6 years, 2 months ago by tsjippy.
    Thread Starter tsjippy

    (@tsjippy)

    Can you please add this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use relative dates in shortcode’ is closed to new replies.