Git Product home page Git Product logo

jsforwp-2020-workshop's Introduction

2020 JS for WP Workshop

In this workshop we learn how to build a small vanilla JavaScript application. We then connect it to the WordPress REST API. From there we import our application into WordPress as a plugin. Finally we refactor our application to run on React rather than vanilla JavaScript.

Part 1 - JavaScript

  1. Start with the 01-javascript-starter folder
  2. Follow along to add a button to the page
  3. Then call a function when the button is clicked
  4. Install and Activate the 02-likes-starter plugin on your WordPress site
  5. Have the button update the likes on your WordPress site via the REST API
  6. Display the like count in the button
  7. Connect to local storage to prevent voting multiple times

Part 2 - WordPress

  1. Go over the code for the 02-likes-starter plugin. Focus on JS and CSS enqueuing, metabox setup and REST API customization
  2. Setup localize script to provide postID and likes count
  3. Import and modify code from vanilla JS example to work in WordPress

Part 3 - React

  1. Install and activate the 03-likes-react-starter plugin
  2. Look over the code. Focus on React dependency, package.json
  3. Install and setup WP Scripts
  4. Convert the plugin to React

jsforwp-2020-workshop's People

Contributors

zgordon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.