Im fairly new to WP development and am trying to create a plugin that generates a widget depending on the settings set in the custom post type. The widget is written in vue.js, and i would like to supply it with data from the WPDB (that i download and refresh using the plugin).
So a user can create a new custom post, set variables (example: URL of where the data is) and other settings inside that post, and then use the shortcode to display the widget.
I've created the plugin, read about custom post types and the REST API and created the frontend Widget.
My problem is this:
- How do i get Data from the DB to the frontend (vue.js)? Can i use the REST API for the WPDB?
- How can i use a custom post type to "feed" information into my widget? I assume i can just get the data from the WPDB about my custom post (storing the settings as part of the custom post), but that just brings me back to the first question.
- Do i use a "post template" to "inject" my widget, or is there something else for that?