-1

It has been a few years since I have done any WP development but have a new project and want to create a plugin to keep the person who controls the site from having to do a specific process over and over again by hand.

My Plugin Concept:

The user will be able to upload images (icons) and associate the following information with each icon upload: Alt Id, Link URL, Caption Title and order of icons. The end result would be a shortcode that the admin can place anywhere and a "Google" style app navigation menu that will pop down on click. The navigation box will have the icons in the order defined. See the google apps menu in the header of google.com

My Question:

Should/Can I leverage any of the current image upload functionality already part of WP? In my workflow below is my use of a unique database for this app menu the best way to accomplish my goal?

My current workflow:

Admin Panel: The admin panel for the plugin will have a form the user can browse to an image, add the info mentioned above via form inputs and on submit the image is uploaded to the WP site and the entry is added to a database created for this plugin. The Admin page would update to show a list of all the current icons ordered by their "Order Number" with the option to delete the icon or edit the info.

Theme Integration: When a user adds a shortcode my plugin will query the database pull the icon data and loop through the query to building a fancy app menu.

I am not looking for anyone to write code but want to make sure my flow of data is correct and if I am leveraging WP's core functionality where possible.

closed as too broad by Jack Johansson, cjbj, Nicolai, bueltge, Fayaz Oct 19 '17 at 2:25

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • When you upload the image it will be stored in wp_posts table, so you can add additional info in wp_postmeta table – Piyush Rawat Sep 27 '17 at 7:04
  • I am not looking at the DB now but would I have to create a new column in wp_postmeta to account for any data that it does not already collect? For example the order id set by the user at upload. – Denoteone Sep 27 '17 at 7:13
  • @Denoteone you dont have to add another column, insert new row for each meta field – Piyush Rawat Sep 27 '17 at 7:25
  • Thanks @PiyushRawat that makes sense. Sounds like everything I can do can be accomplished by using DB's and upload functionality already baked into WordPress. If you want to summarize your comments in an answer I will accept it. – Denoteone Sep 27 '17 at 7:34
0

Firstly you can upload the image using wp_media_handle as it returns attachment id.

Then try to add your desired metafields by passing the same id in each of them.

Not the answer you're looking for? Browse other questions tagged or ask your own question.