php - Very simple upload form for wordpress plugin -



php - Very simple upload form for wordpress plugin -

i have simple plugin in wordpress. have function , utilize add_submenu_page add together function main function (plugin).

i want add together upload form upload images in submenu_page . images should uploaded wp-content/uploads.

so there simple form this? want main wp functions don't know how it.

just needing simple form upload images in wp-content/uploads folder. how ?

thanks.

i did next plugin built. dead simple!

firsty need enqueue wordpress media upload so:

add_action('admin_enqueue_scripts', 'my_scripts'); function my_scripts() { wp_enqueue_media(); }

you need give the input button id of upload_image_button here's example:

<input id="upload_image_button" class="button" type="button" value="select logo" />

to display file location in input, utilize following:

<input size="50" id="upload_image" type="text" name="ad_image" value="" />

i hope helps!

php wordpress

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -