b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Developer Reference
  3. Plugins
  4. Plugin development
  5. How to write a new plugin

How to write a new plugin

This man page refers to b2evolution version 1.6

The easiest way is this:

  • Make a copy of the file _test.plugin.php
  • Rename the new file to _newname.plugin.php (choose whatever newname you want)
  • Open the _newname.plugin.php file.
  • Rename the class from test_plugin to newname_plugin . Make sure you use the same newname as above. Note: when renaming the class, you must also rename the constructor (first function). (Doing a Search & Replace on test_plugin in the whole file would be a good idea in order to update comments also).
  • Give appropriate values to all variables in the section "Variables below MUST be overriden" as well as in the Constructor.
  • In the section "Variables below MAY be overriden", redefine everything you need and delete anything you don't need. You may want to check /b2evocore/_class_plugin.php for additional possible variables to override.
  • In the functions list, delete all functions you don't need, and reimplement the ones you need. You may need to keep only one function. The TEST plugin reimplements almost all event handling functions, however you may want to check /b2evocore/_class_plugin.php for additional possible event handlers to override.

When you're done, make sure to install your plugin in the Settings admin before you attempt to use it.

Created by fplanque • Last edit by fplanque on 2015-12-30 02:03 • •

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
    • Website Skins/Themes
    • Email Skins/Themes
    • b2evolution Files
    • Website Integration
    • Plugins
      • Introduction to Plugins
      • Renderer Plugins
      • Plugin development
        • Localizing Plugins
        • Plugin API for item settings
        • Coding Standard Guidelines
        • How to turn plugins on/off
        • How to write a new plugin
        • Creating A Plugin
        • Plugin / Apply Rendering
        • Plugin Documentation
        • Plugins Repository
        • Creating an Antispam Plugin
        • List of Plugin Hooks
      • Plugin / Apply Rendering
      • Widget Plugins
    • Debugging
    • Technical Reference
    • Hacks
    • Credits
    • Development
    • How to... (Customize)
    • Scheduled Tasks Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque