Title: feature req: allow variables in php code
Last modified: August 22, 2016

---

# feature req: allow variables in php code

 *  Resolved [atomizer](https://wordpress.org/support/users/atomizer/)
 * (@atomizer)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/feature-req-allow-variables-in-php-code/)
 * i don’t know if any of these messages are being posted as they’re not showing
   up in the support form
 * anyway…
 * would be great if variables could be used inside of php code, which doesn’t seem
   possible at the moment
 * like
    `echo 'hi %%name%%` then the block would be like `[contentblock name=”geek”
   id=16 img=php.png]
 * [https://wordpress.org/plugins/global-content-blocks/](https://wordpress.org/plugins/global-content-blocks/)

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

 *  [v3r50r](https://wordpress.org/support/users/v3r50r/)
 * (@v3r50r)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/feature-req-allow-variables-in-php-code/#post-5752933)
 * Hello,
    I don’t see why this would not work. Attributes are processed before 
   the PHP code is evaluated, so this should work as intended. I am not able to 
   test this at the moment, but will look into it in a few hours.
 *  Thread Starter [atomizer](https://wordpress.org/support/users/atomizer/)
 * (@atomizer)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/feature-req-allow-variables-in-php-code/#post-5752936)
 * hi v3r50r
 * it DOES work!
    i was writing the php code incorrectly!
 * LOL – this will greatly cut down on the number of content blocks i have 🙂

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

The topic ‘feature req: allow variables in php code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/global-content-blocks_c8cac8.svg)
 * [Global Content Blocks](https://wordpress.org/plugins/global-content-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/global-content-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/global-content-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/global-content-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/global-content-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/global-content-blocks/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [atomizer](https://wordpress.org/support/users/atomizer/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/feature-req-allow-variables-in-php-code/#post-5752936)
 * Status: resolved