# Using Variables in WP and PG Interactions

**URL:** <https://forum.pinegrow.com/t/using-variables-in-wp-and-pg-interactions/9998>\
**Category:** Pinegrow Interactions Add-on\
**Created:** [November 7, 2024, 8:58pm UTC](https://forum.pinegrow.com/t/using-variables-in-wp-and-pg-interactions/9998 "2024-11-07T20:58:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)\
**Post date:** [November 7, 2024, 8:58pm UTC](https://forum.pinegrow.com/t/using-variables-in-wp-and-pg-interactions/9998/1 "2024-11-07T20:58:31Z")

</div>

Hey,

I try to create a Wordpress block with a Pinegrow Interaction animation. The Animation sets a src value of an element. I would like to be able to type in the src attribute in the Wordpress block editor.

Maybe the best way is to set a block attribute and define a variable which I can use in the Interactions?

Does anyone has an idea? @adamslowe

---

<div class="post-metadata">

**Author:** ![adamslowe](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/adamslowe/32/4590_2.png) [@adamslowe](https://forum.pinegrow.com/u/adamslowe)\
**Post date:** [November 10, 2024, 2:16pm UTC](https://forum.pinegrow.com/t/using-variables-in-wp-and-pg-interactions/9998/2 "2024-11-10T14:16:55Z")

</div>

Oooh, that’s an interesting use case. I can’t say that I’ve done anything like this before, but your solution seems to make sense.

Can you give us a little more information about what you are trying to do? Maybe someone else has done something similar or can point you in the right direction?

---

<div class="post-metadata">

**Author:** ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)\
**Post date:** [November 11, 2024, 1:05pm UTC](https://forum.pinegrow.com/t/using-variables-in-wp-and-pg-interactions/9998/3 "2024-11-11T13:05:19Z")

</div>

Thanks for you reply! I try to build a consent tool for YouTube Videos. It’s an iframe which gets a src parameter (video url) after clicking “I agree”. Clicking the agree button starts a Pinegrow interaction which sets the src to the iFrame. I works fine.

But I want to use it as / in a Wordpress block and the user should be able to type in the video url as a block attribute.

---

<div class="post-metadata">

**Author:** ![Riccarcharias](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/riccarcharias/32/4051_2.png) [@Riccarcharias](https://forum.pinegrow.com/u/Riccarcharias)\
**Post date:** [November 13, 2024, 6:23am UTC](https://forum.pinegrow.com/t/using-variables-in-wp-and-pg-interactions/9998/4 "2024-11-13T06:23:39Z")

</div>

Any Ideas? @matjaz @Emmanuel @RobM
