- Messages
- 3
- Likes
- 0
- Points
- 1
Hi there!
I'm trying to pass a PHP variable onto one of my custom edited plugins.
I'll try to describe below:
On one of my custom edit php files of "Eventon - Action User" WP plugin, I've a dropdown which I want to control the dropdown options via a PHP variable, like:
$variable = [
"opt1" => "/opt1",
"opt2" => "/opt2",
"opt3" => "/opt3",
];
... more code!
I've manged to do this directly on the .php file. But what I want to achieve is to just replace the variable with a shortcode, where I can have the variable inside the shortcode, so I can manage the dropdown options through Woody Snippets, and don't have to necessarily edit the php file.
This is what I'm doing and it's not working:
echo do_shortcode('[wbcr_php_snippet id="6296"]');
... more code!
and... in the Woody Snippet "6296" I have:
$variable = [
"opt1" => "/opt1",
"opt2" => "/opt2",
"opt3" => "/opt3",
];
Am I doing something wrong?
Cheers Alex!
I'm trying to pass a PHP variable onto one of my custom edited plugins.
I'll try to describe below:
On one of my custom edit php files of "Eventon - Action User" WP plugin, I've a dropdown which I want to control the dropdown options via a PHP variable, like:
$variable = [
"opt1" => "/opt1",
"opt2" => "/opt2",
"opt3" => "/opt3",
];
... more code!
I've manged to do this directly on the .php file. But what I want to achieve is to just replace the variable with a shortcode, where I can have the variable inside the shortcode, so I can manage the dropdown options through Woody Snippets, and don't have to necessarily edit the php file.
This is what I'm doing and it's not working:
echo do_shortcode('[wbcr_php_snippet id="6296"]');
... more code!
and... in the Woody Snippet "6296" I have:
$variable = [
"opt1" => "/opt1",
"opt2" => "/opt2",
"opt3" => "/opt3",
];
Am I doing something wrong?
Cheers Alex!