• Hello!

    Got a question about nested shortcodes for you.

    I need to generate a list of checkboxes from a custom post type.

    Watch it here https://www.test3.websitehebben.com/sandbox/

    I use a php snippet to output the list. I call it from a shortcode, which works with CF7.

    However I need to use it nested! Unfortunately I can’t get it to work. I tried accordeons, double quotes, single qoutes, the works.

    Any help would be much appreciated ??

    Below is what my CF7 edit screen looks like

    Regards

    Janco


    I want to create something like this:

    <p>Checkboxes:
    [checkbox checkbox-204 use_label_element “8 footer” “10 footer” “12 footer” “14 footer”]</p>

    <p>Checkboxes:
    [checkbox checkbox-204 use_label_element “list of boats”]</p>

    When I include the php snippet not nested it outputs this:
    [php snippet=5]
    Which is fine.

    However, when I inlcude it nested it outputs this:
    [checkbox checkbox-204 use_label_element [php snippet=5] ]
    Which is a bummer.

    How now?

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The CF7 plugin (and any plugin that is security conscious) is highly likely to escape any PHP that is inserted in a Shortcode for security reasons.
    ?
    ?To insert a list of checkboxes from a custom post type generated by PHP you would probably need to add this functionality via a suitable CF7 hook.
    ?
    ?See https://hookr.io/plugins/contact-form-7/ for a list of all current Contact Form 7 hooks.

    Thread Starter Janco147

    (@janco147)

    Thanks! And wow, that’s a whole bunch of hooks.
    I’m a hook noob, could you make a suggestion please?

    Sorry that would take just too much of my time – I can only in this case point you in the direction where you can learn how to do it yourself.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘nested php snippet’ is closed to new replies.