• Resolved cope916

    (@cope916)


    Hi there,
    I am using CF7, CFDB, and the shortcodes actions and filters plugin and I’ve gotten my shortcode working. But now trying to filter the results by submit time isn’t working out. I tried the shortcode builder to make sure my submit time was valid, and it was. Then I tested from the shortcode builder page the following shortcode link
    [cfdb-value form="Guest List" show="your-name" filter="submit_time>last week"]
    which from the shortcode builder page did display results, however testing from an unpublished draft of a wordpress post did not display anything, so I’m wondering if there’s some sort of disconnect with the submit time and displaying on the site? I didn’t set any security options and my short code that I built worked out other than trying to add a filter for sort time.

    This is my shortcode, titled shortcode2

    require_once(ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php');
    $exp = new CFDBFormIterator();
    $exp->export($atts['form'], $atts);
    while ($row = $exp->nextRow()) {
        if ($row['menu-838'] != 0) {
            echo $row['your-name'];
    		echo " +{$row['menu-838']} <br />";
        } else {
    		echo $row['your-name'] . '<br />';
    	}
    }

    The following shortcodes did display results

    [myshortcode2 form="Guest List" filter="checkbox-376~~/.*Friday/"]
    [myshortcode2 form="Guest List" filter="checkbox-376~~/.*Saturday/"]

    The following shortcodes did not display results

    [cfdb-value form="Guest List" show="your-name" filter="submit_time>last week"]
    [myshortcode2 form="Guest List" filter="Submitted>-last week"]
    [myshortcode2 form="Guest List" filter="submit_time>-7 days&&checkbox-376~~/.*Saturday/"]
    [myshortcode2 form="Guest List" filter="submit_time>7 days&checkbox-376~~/.*Saturday/"]

    As always your help and insight are greatly appreciated.
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Looking just at your cfdb-value shortcode, I think you have a line break in it. So when you put it in a post, WP does not see the second line which contains the filter. Ensure there are no line breaks in your shortcodes.

    Thread Starter cope916

    (@cope916)

    My apologies on that first short code example, I must have accidentally hit enter while putting that on. I assure you that my shortcode has no line breaks, I even went back and double checked and it is exactly how the shortcode is shown on the other code examples.

    Plugin Author Michael Simpson

    (@msimpson)

    OK. When editing the post, switch the WP Editor to “Text” mode instead of “Visual” and make sure the shortcode is still the same and doesn’t have any HTML special character codes in it.

    Thread Starter cope916

    (@cope916)

    I had it in text mode since the beginning for that reason. Out of respect for you and your time I double checked, and it was in text mode. In thinking of other possible scenarios I tried switching it to visual then I checked and now it seems to be working? I’m stumped, but grateful that it seems to be working now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sort by submit_time not displaying’ is closed to new replies.