Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Adding a new SBT widget to the Wordpress plugin

Benjamin Jakobus edited this page Jan 24, 2014 · 2 revisions

Note: The SBT Wordpress plugin is an experimental plugin.

Step 1: Copy the file containing your widget code (JavaScript and HTML) into wordpress/wp-content/plugins/sbtk-wp/views

Step 2: Open wordpress/wp-content/plugins/sbtk-wp/sbtk-wp.php

Step 3: Create a new function that contains the following code:

function widget_sbtk_my_widget($args) { create('views/my-widget-file.php'); }

Rename the function as needed and replace** my-widget-file.php ** with the name of your file.

Step 4: Register the function created in step 3 using wp_register_sidebar_widget: Place the following after line 288 in sbtk-wp.php:

wp_register_sidebar_widget('widget_sbtk_my_widget_id', 'My Widget Name', 'widget_sbtk_my_widget_id', array('description' => 'Enter some widget description here.'));

Step 5: Save your changes. Log into the Wordpress administration page and go to "Appearance" -> "Widgets". Drag and drop your widget onto your page as needed.