Title: Nesting another shortcode inside
Last modified: August 31, 2016

---

# Nesting another shortcode inside

 *  Resolved [calman6](https://wordpress.org/support/users/calman6/)
 * (@calman6)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/nesting-another-shortcode-inside/)
 * Hi,
 * Does anyone know how I could nest another shortcode inside this one?
 * e.g.
 * [gdoc key=”[https://docs.google.com/spreadsheets/……&#8221](https://docs.google.com/spreadsheets/……&#8221);
   use_cache=”no” query=”select A, B, C where A = “[urlparam param=”domain” /]”]
 * The [urlparam] shortcode grabs a get variable from the url. Works on it’s own
   but does not work when inside gdoc shortcode.
 * Was reading about do_shortcode needing to be applied to the outside shortcode
   i.e. gdoc, but having trouble working this out.
 * Many thanks!
 * [https://wordpress.org/plugins/inline-google-spreadsheet-viewer/](https://wordpress.org/plugins/inline-google-spreadsheet-viewer/)

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

 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/nesting-another-shortcode-inside/#post-7164045)
 * This isn’t something you can do with shortcodes, and anyway it isn’t something
   specific to this plugin. You should probably ask this question on [the general “how to” forum](https://wordpress.org/support/forum/how-to-and-troubleshooting),
   where you’re more likely to get help.
 *  Thread Starter [calman6](https://wordpress.org/support/users/calman6/)
 * (@calman6)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/nesting-another-shortcode-inside/#post-7164105)
 * Thank you for the reply, I ended up using the ‘Insert PHP’ plugin and then the
   following in the post:
 *     ```
       [insert_php]
       $domain = htmlspecialchars($_GET["domain"]);
       echo str_replace('$', '\$', do_shortcode('[gdoc key="https://docs.google.com/spreadsheets/......" use_cache="no" query="select * where A = \''.$domain.'\'"]'));
       [/insert_php]
       ```
   
 * Thank you very much for Inline Google Spreadsheet Viewer, very useful plugin!
 *  Plugin Author [Meitar](https://wordpress.org/support/users/meitar/)
 * (@meitar)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/nesting-another-shortcode-inside/#post-7164138)
 * If that’s all you were trying to do then you should have a second look at this
   plugin’s documentation, specifically the `gdoc_query` filter hook, for a much
   safer way to do that. An [example](https://wordpress.org/support/topic/qdoc-query-under-other-notes-bottom-of-screen-example-request?replies=3).

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

The topic ‘Nesting another shortcode inside’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Meitar](https://wordpress.org/support/users/meitar/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/nesting-another-shortcode-inside/#post-7164138)
 * Status: resolved