Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Delicious Brains:
Build A WordPress Plugin With Vue 2
Jul 11, 2018 @ 15:46:16

On the DeliciousBrains.com site they've posted a tutorial showing you how to create a WordPress plugin using Vue.js to make interaction with the page simpler (and nicer than just a normal page reload).

It’s been a while since we’ve played with Vue JS on this blog, so why don’t we take a beginner-focused look at how one might go about building a simple polling plugin for WordPress with Vue.

Why Vue? Vue can scale up to be used for full-blown single page applications, but you can also use it to add small bits of interactivity to sites, pages, or plugins where in the past you may have used jQuery.

[...] Why a polling plugin? There are scores of polling plugins for WordPress, most of them are free, and most of them will be better than the one we’re going to build today, but there is something missing from the current offering of polling plugins: none of them are polka themed…

They start off with the PHP code required to power the plugin (a.k.a. "Pollka King") and load the required resources. They make use of a shortcode to refer to the plugin and show the structure they'd like to use in the editor to create the poll. The backend and frontend code is included along with screenshots of how it should look along the way.

tagged: tutorial wordpress plugin vue2 vuejs poll

Link: https://deliciousbrains.com/vue-2-wordpress-plugin-tutorial/


Trending Topics: