>
Download This Plugin | |
Download Elegant Themes | |
Name | Easy Widgets |
Version | 1.1.1 |
Author | Talasan Nicholson |
Rating | 100 |
Last updated | 2012-09-17 03:10:00 |
Downloads |
1085
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Easy Widgets plugin added 12 bytes of resources to the Home page and 4 bytes of resources to the sample Post page.
Easy Widgets plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Easy Widgets plugin ads no tables to your Wordpress blog database.Easy Widgets plugin provides an API to easily add widgets in WordPress.
In widgets.php, do something like below:
/**
* Custom widgets.
*/
$prefix = 'replaceMe_';
$widgets = array();
// -----------------------------------------------
/**
* easyBox widget
*/
$widgets[] = array(
'id' => 'easyBox',
'title' => $prefix.'easyBox',
'desc' => 'Create a simple text widget',
// All fields can be called by their
// simple variables: title => $title
'fields' => array(
array(
'name' => 'Title',
'id' => 'title',
'type' => 'text'
),
array(
'name' => 'Body',
'id' => 'body',
'type' => 'textarea'
),
array(
'name' => 'Category',
'id' => 'category',
'type' => 'select',
'options' => array(
'one',
'two',
'three'
)
)
),
// This is what will appear in the sidebar as HTML
'output' => '
<article class="easyBox">
<h1><?=$title?></h1>
<small><?=$category?></small>
<p><?=$body?></p>
</article>
'
);
// -----------------------------------------------
/**
* Iterate and register the widgets
*/
if (class_exists('WidgetCreator')) {
foreach ($widgets AS &$w) {
$WC = new WidgetCreator($w);
eval($WC->render());
}
}
else trigger_error('WidgetCreator does not exist.', E_USER_ERROR);
More to come soon, as it seems necessary. You may request new fields.