Code Monkey home page Code Monkey logo

wordpress-plugin-boilerplate's Introduction

WordPress Plugin Boilerplate

Introduction

This is an object oriented boilerplate for developing a WordPress plugin.

The main class uses the Singleton pattern to make sure that only one instance of the plugin is ever created.

Blank methods for activation, deactivation, and registering scripts and styles are included and tied to the correct hooks.

The base class sets up the text domain for internationalization and localization. Just drop your i18n and l10n files into the lang directory and change the $text_domain property to your text domain.

A blank uninstall file is included. It is setup to make sure it can only be called from the WordPress dashboard.

All custom plugin functionality should be added to the run_plugin() method.

Setup

  1. Clone or download the source to your plugin directory
  2. Rename the folder to the name of your plugin
  3. Rename wordpress-plugin-boilerplate.php to NAME_OF_YOUR_PLUGIN.php
  4. Rename the WordPress_Plugin_Boilerplate class to NAME_OF_YOUR_PLUGIN
  5. Change the class name in the WordPress_Plugin_Boilerplate::get_instance(); line to the name of your class
  6. Update the plugin header with your plugins information
  7. Set the $text_domain property to your text domain
    • This is only needed if you are using text domains for i18n and i10n
  8. Start coding

wordpress-plugin-boilerplate's People

Contributors

sas05 avatar theantichris avatar tivnet avatar

Watchers

 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.