How to use media uploader in wordpress custom plugin

4

If you’re developing own wordpress plugin may be you have to use upload image in the custom field.So in here i’m going to explain all how to use media uploader in your wordpress settings page.

How to use media uploader in wordpress custom plugin

This is my folder structure.
How to use media uploader in wordpress custom plugin

My main file is index.php.There I’m adding wordpress code functions to fetch related files.

Now I’m adding my js file named admin_script.js into settings page.

Okay.Next step is adding html fields to settings page(settins.php) of my plugin page.

Now add the js into the admin_script.js file.

After added all you can see it in admin page as following.

How to use media uploader in wordpress custom plugin

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.