Logo

Creation of WordPress extensions - Development of a short code to display the extension on the pages

Today we will see how to create a WordPress plugin to display a contact form on a website. Thanks to today’s video, you will see how to use the “WORDPRESS PLUGIN BOILERPLATE GENERATOR” solution to generate the basic functionalities.

WordPress plugins give you the ability to extend the functionality of your website. In today’s video, we’ll see how to create a WordPress plugin. At the end of this video, you will be able to:

  1. use some of the features and platforms available to you to create extensions that you can use on your site
  2. generate the short code to be able to display the extension on any page of your website

Creation of WordPress extensions

The steps for creating an extension are as follows:

  • Go to the wppb.me site which gives the possibility to generate the basic functionalities of an extension for free.
  • When you are on WordPress plugin Boilerplate Generator, fill in the basic information in the form: Plugin name (Example: My contact form), Plugin slug or Short url of your extension (Example: Contact form), Plugin Uri (Url where you will like to display the documentation of your extension p (eg Url that refers the customer or visitor to a description), author, author’s email address.
  • After filling out the whole form, click on Build Plugin and automatically on your screen a set of files will be downloaded.
  • Copy the extension to the WordPress Plugin directory (the Plugin is in the wp_content folder). Open the file and import the create contact form and check out.
  • A new “ContactForm” folder with information such as: Admin, language, public, etc.
  • The advantage of using wppb is that you have almost all the functionality you need to start developing an extension.
  • If you open the main Contact Form extension file you would have the basic information (Url, Plugin name) that you can modify to get what you want. By refreshing the page the extension appears in the WordPress administrator panel.

Development of a shortcode to display the extension.

Shortcodes allow you to display code snippets anywhere on your website. For example, if you have a subscription form in the form of a shortcode, you can simply paste it on any page to make it appear on the site. Shortcodes are usually written between square brackets. Below are the steps to follow:

  • Open the file and you will have the information that appears. You can create a function: pro contact form to be able to generate the short code
  • Use the WordPress function (Short code) which takes 2 parameters: name of the Pro code and the name of the function you have created. That is, display the information that is in the Form that does not yet exist as a shortcode.
  • Create function the Form by displaying my contact form.
  • Add the already prepared form (you can write a form in HTML and paste it)
  • Add the Up Start and Up get Clean function. These 2 parameters allow us to avoid displaying information when placing an order.
  • Create a test page (tests) and add the short code you created and click on save.
  • If you open the page, the contact form appears. All that remains is to create another function to allow the action to be executed if someone clicks submit.

Video summary

The essential steps for creating an extension are as follows:

  • Generate the basic functionalities via the site https://wppb.me
  • Import and extract .zip files
  • Create PHP or WordPress functions to achieve your goals
  • Develop the shortcode
  • Log in to your admin panel and activate the extension.

If you have any questions or comments, please do not hesitate to Contact us .

Montréal

Our adress

9590 Boul Henri-Bourassa E Bureau 108, Montreal-Est, Quebec H1E 2S4, Canada

Subscribe to receive our news straight to your inbox.