Title: nested php snippet
Last modified: August 30, 2016

---

# nested php snippet

 *  [Janco147](https://wordpress.org/support/users/janco147/)
 * (@janco147)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/nested-php-snippet/)
 * 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 [http://www.test3.websitehebben.com/sandbox/](http://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://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Neil Murray](https://wordpress.org/support/users/buzztone/)
 * (@buzztone)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/nested-php-snippet/#post-6806842)
 * 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 [http://hookr.io/plugins/contact-form-7/](http://hookr.io/plugins/contact-form-7/)
   for a list of all current Contact Form 7 hooks.
 *  Thread Starter [Janco147](https://wordpress.org/support/users/janco147/)
 * (@janco147)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/nested-php-snippet/#post-6806938)
 * Thanks! And wow, that’s a whole bunch of hooks.
    I’m a hook noob, could you make
   a suggestion please?
 *  [Neil Murray](https://wordpress.org/support/users/buzztone/)
 * (@buzztone)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/nested-php-snippet/#post-6806951)
 * 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.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [nested](https://wordpress.org/support/topic-tag/nested/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 2 participants
 * Last reply from: [Neil Murray](https://wordpress.org/support/users/buzztone/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/nested-php-snippet/#post-6806951)
 * Status: not resolved