Coder Social home page Coder Social logo

plugin-generator's Introduction

Getting Started

  1. Use the WP Plugin Generator
  • Create settings fields by adding to the array in the render method in admin/class-admin.php.

  • Get the data from your settings fields in the render method in frontend/class-frontend.php where it says controller.

  • Use that data in your default template found in frontend/partials/view.php.

  • Users will have the ability to create their own template in a folder called partials/plugin-name.php in their theme. All the variables you declare in the controller will be accessible to them.

  • Here is an example of how to make an AJAX call in the admin.

Without Generator

If you did not use the generator, change the following generic info:

  • Namespaces in all PHP files - namespace PLUGIN_NAME;
  • ./plugin-name
  • plugin-name.php
  • class-info.php - SLUG, VERSION, OPTION_NAME, UPDATE_URL
  • Make sure the UPDATE_URL has a trailing slash at the end
  • frontend/class-frontend.php - assets method
  • fronend/js/plugin-name-frontend.js
  • fronend/css/plugin-name-frontend.css
  • admin/class-admin.php - assets method
  • admin/class-admin.php - text domain
  • admin/js/plugin-name-admin.js
  • admin/css/plugin-name-admin.css
  • uninstall.php - option names

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.