0

Hey i have a program of wordpress plugin in which i have a list in the admin section and i want to get the value from that list box to store in a variable $y but i don't know how can i do it . Please help me as i am a beginner for wordpress plugins.

  • By list, do you mean a form drop-down? Do you want the variable to be used on the same page as the admin php page or different page? – Kevin Z Mar 16 '14 at 07:39
  • Ya i mean the drop down form and i wanted to show that results above the content in post page – user3296690 Mar 16 '14 at 08:17

1 Answers1

0

You'll want to make that drop down a form so when you save those settings, it is written in a global variable. Then you can pull that variable on the post page. Check out this post for setting global variables: How to declare a global variable in php?

To set it, in the php file that you call from the form submission, pass a url parameter using GET (http://www.php.net/manual/en/reserved.variables.get.php) and then you can put it on the post page.

Community
  • 1
  • 1
Kevin Z
  • 341
  • 8
  • 16