Title: Nested Shortcodes
Last modified: March 28, 2018

---

# Nested Shortcodes

 *  Resolved [dmldml](https://wordpress.org/support/users/dmldml/)
 * (@dmldml)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/nested-shortcodes-13/)
 * I want to embed a Google Sheet and only show the rows where Column A contains
   the email address of the currently logged-in WordPress user.
 * I’m using the “Insert PHP Code Snippet” plugin by xyzscripts to grab the email
   address of the currently logged-in user. It created the shortcode:
 * [xyz-ips snippet=”user-email”]
 * which executes the following code:
 * <?php $current_user = wp_get_current_user(); ?>
    <?php echo $current_user->user_email;?
   >
 * I’m trying to nest that shortcode inside the Inline Google Spreadsheet Viewer
   shortcode, as follows:
 * [gdoc key=”[https://docs.google.com/spreadsheets/d/123567/edit?usp=sharing&#8221](https://docs.google.com/spreadsheets/d/123567/edit?usp=sharing&#8221);
   query=”select * where A = ‘[xyz-ips snippet=”user-email”]'”]
 * But this doesn’t work. It renders properly if I hard-code the email address into
   the Inline Google Spreadsheet Viewer shortcode, but I need it to dynamically 
   use the email address of the currently logged-in WordPress user.
 * How can I solve this?

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

 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/nested-shortcodes-13/#post-10124632)
 * WordPress doesn’t support nested shortcodes.
 * Next time, you can solve this problem by better researching the tools you’re 
   using:
 * [https://wordpress.org/support/topic/qdoc-query-under-other-notes-bottom-of-screen-example-request/](https://wordpress.org/support/topic/qdoc-query-under-other-notes-bottom-of-screen-example-request/)
 *  Thread Starter [dmldml](https://wordpress.org/support/users/dmldml/)
 * (@dmldml)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/nested-shortcodes-13/#post-10141251)
 * THANK YOU !!
 * I actually did spend hours searching for a solution, including reading your instructions
   and support tickets, but I didn’t manage to find the post that you shared.
 * I’ve managed to get this working. Super happy about it, thanks so much.
 * cheers

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

The topic ‘Nested Shortcodes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/inline-google-spreadsheet-viewer.
   svg)
 * [Inline Google Spreadsheet Viewer](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/)
 * [Active Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/inline-google-spreadsheet-viewer/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [dmldml](https://wordpress.org/support/users/dmldml/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/nested-shortcodes-13/#post-10141251)
 * Status: resolved