Content of the page

Creating an custom extensions

Content of the article

WOOBE allows to create custom extensions which should be placed in folder: wp-content/woobe_ext

Here are some existed native extensions for example:


Extension functionality can be presented in tabs: top tabs and basic tabs, or without any tabs, as 'calculator' for example.

Let's consider the most simple extension as Info:

  • Its folder has name 'info'
  • Inside folder 'info' should be: info.php, views/panel.php, js/info.js, css/info.css and can be also folder img if its necessary
  • info.php has PHP class inside as WOOBE_INFO which extends class WOOBE_EXT
  • in class WOOBE_INFO should be defined protected variable $slug with value 'info'
  • in the constructor of class WOOBE_INFO  should be defined next code to create tabs:

    To create tabs in the top slider (where is filter,bulk,export) the code should be:

    Look closer to the code to see the difference: panel -> top_panelwoobe_ext_panel_ -> woobe_ext_top_panel_
  • If we need to use any js and css in the our extension write function woobe_ext_scripts:

    This code will include styles for our extension and future js actions
  • Function woobe_ext_panel will show any forms we need to see in our application. Of course it will show HTML code which you will write in file views/panel.php, for example any popups there
  • So now we have the most simple application which is possible to create. To write your logic you need to see code of extensions which you can download on this page as examples or see native extensions of WOOBE in folder wp-content\plugins\woocommerce-bulk-editor\ext
  • ATTENTION: for external extensions should be defined protected variable $is with value 'external'

Some actions:

  • woobe_adv_panel_buttons_end - will add any html on the end of tools panel in the Products Editor tabs, see example in extension 'bulk'
  • woobe_adv_panel_buttons - will add any html on the beginning of tools panel in the Products Editor tabs, see example in extension 'bulk'
  • woobe_page_end - with this hook you can render any additional html elements you need for your application, see as example extension calculator
  • woobe_before_update_page_field - hook which can be executed before products field update: models/products.php
  • woobe_after_update_page_field - hook which can be executed after products field update: models/products.php

  • woobe_bulk_started - hook before bulk editing started: \ext\bulk\bulk.php
  • woobe_bulk_going -  hook while bulk editing going: \ext\bulk\bulk.php
  • woobe_bulk_finished - hook after bulk editing done: \ext\bulk\bulk.php

Some variables:

  • woobe_checked_products - (js) ids of the selected products in the Products Editor
  • woobe_bind_editing - (js) is bind editing enabled
  • woobe_show_variations - (js) is variations shown
  • woobe_adv_panel_full_width - (js) is full width activated
  • global $WOOBE - (php) global plugin main variable you can use