Formator is a latent superhero. On the surface, formator looks like a simple plug-in, but if you take time to check the formator API, you will find that there is a beast waiting for liberation under the hipster glasses and vest. Unlike other form plug-ins, the formator API will not be blocked by expensive Alipay, but everyone can use it. This will give you the opportunity to create unique applications and extensions using the formator, and provide unlimited possibilities for your customization. Even better, third-party developers based on formator can create customized business solutions for customers and sell them in the open market to obtain additional revenue. The formator API has a lot of value, waiting to be unlocked. The
This post will show you how to use the API to build a simple dashboard plug-in in word press. But what we are making is not the focus of this tutorial. My goal is to build this simple plug-in and teach you how to access it yourself. After identifying the available content, I hope you can get some ideas. If you teach a man to use APIs, he will create lifelong extensions. The formator API supports CRUD (create, read, update, delete) operations for forms, polls, quizzes, and corresponding items. The
Here are some methods available: Get\u forms() delete form() add\u form() update\u poll() delete\u quizzes() get\u form\u fields\u by\u type() update\u form\u setting() move\u formu field() add\u form\entry() update\poll\u entry() this is not a complete list. The API documentation describes all the methods for building plug-ins. For the purposes of this guide, we will use the formator API to build custom artifacts for word press dashboards that display recent projects. You will search for items to display in constructs, but you can also modify them slightly to display in pages or posts. The
The following is what we want to build. Let’s start by creating a plug-in for WordPress. This is a formator attachment, so you want to run the plug-in only when the formator is active, so use the \
This guide uses wp\u dashboard\u setup to add parts to WordPress dashboard pages. The wp\dashboard\u setup hook is invoked to load the part. In the following add\formator\dash\widget function, instantiate the next formator\submissions\dash\widget class to be created. Create a loading summary 24ad973beb03b5bf259d240813877a52 dashboard part class. The following is imported from WordPress Codex. All features of the plug-in must have unique names that are different from the word press core, other plug-ins, and theme features. Therefore, it is recommended to use a unique feature name prefix for all features of the plug-in. A better possibility is to define plug-in functionality within a class (high)
Limited name). The
That is, we will start by choosing a better path and creating a unique plug-in class called formator_submissions\dash\u widget. Store the class instance in the class, identify the form ID to search for submission, and enter the submission quantity to display. If you copy and paste this code block, the site is not damaged because the code block is closed with braces. Remember that the code blocks for the rest of this tutorial are curly braces. To use this plug-in on your site, it is recommended that you import the complete code from GitHub instead of copying and pasting each bit. The
To instantiate the load summary 63e288a13f9dd2e7305696b45101a30 plug-in class, you must import the class instance. Load the key point b66e7b3ceb731194629f3321e784d51, then declare the generator method (unnecessary, empty), and register the dashboard component. Male loading summary 69c144469a86c32f925f42dddd8082bfb does not want to display parts to all WordPress users, so add user_allowed() to ensure that users can view parts. Then, set the option default to fallback in case the component is not configured. The next section creates a configuration box. The
If the user cannot see the component, a message is displayed; otherwise, the submission is accepted. Add the following configuration box to load the summary ef9dada5cfc51dc1584a947ef642273a part configuration user can configure the part: Male specify the number of tables and items to view here. To do this, add the configure () method and update and import options to allow component configuration. Let’s start with the configure () method. In order to update the load summary 3c4aa4b7970137e7bf68452496a3676e, you must obtain all dashboard component options from the database and create an array to merge the old options with the new options. The
After loading the summary 2af3016bcf422cf98f47629deb667d4, search the database for part options. Loading summary 52f2d3bbff615e0c602d5720899f93bf the saved 4minuator now uses the formator API to populate the dashboard part, which is the part everyone is waiting for. Use the formator_api:get\u form() and the formator\u API:: get\u form\u entries() to import submissions. Also, make sure that the form ID of the display item is set. If it is not set, the system will prompt the user to configure the dashboard plug-in correctly. The
In addition, the form is checked for successful loading and the submission form is rendered. All of this goes to the get_submits() method, as follows: Load summary 2f624480167e30b4b9b07792eab8d365 now has forms and submission data, so you must create a dimension rendering method. To do this, we will use render_form_submissions(). Displays data in an HTML table and displays the number of previously specified items. Load summary 3b0131df19fb461466550a39a5bd66f2a now the new part is fully working. Use the formator API to search the submitted data! The
If you are interested in further customizing the WordPress administration area, please review this guide and the guide for creating marketing dashboards in WordPress. To use this component on the site, GitHub can get all the code for the formator dashboard component. Hastar ravista, baby dashboard component for a simple demonstration of this tutorial
OK. This is just the beginning of what the formator can do. Take a closer look at the formator API to see what you can think of. Formator is available here for free. Do you want to learn more about development? Start with a guide to writing function methods. I’m really looking forward to what the formator framework can build. Now I want to hear your opinions. Are you still using formator? How’s it going? What extension of the formator do you want to create? Label: formator API function based on API system in PHP management field