简体   繁体   中英

How can i take out value from the wordpress admin list box

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM