-
Notifications
You must be signed in to change notification settings - Fork 55
Home
scribu edited this page Feb 10, 2012
·
31 revisions
scbFramework is a collection of classes that speed up WordPress development.
To get a quick start on using the framework, see the example plugin on WordPress.org.
The framework contains the following classes:
- scbForms - form generator
- scbOptions - option handling
- scbAdminPage - admin page creation
- scbBoxesPage - admin page with meta boxes
- scbWidget - widget creation
- scbCron - wp-cron handling
- scbTable - database table creation
- scbHooks - automatic filter binding
- scbUtil - useful functions
There are two "official" ways to load the scbFramework files:
- Move the scbFramework folder to
wp-content/plugins/my-plugin/scb
.
Then, just require the load.php
file:
<?php
// Plugin Name: My plugin
require dirname( __FILE__ ) . '/scb/load.php';
# $option = new scbOptions( 'my_plugin' ); // Error: scbOptions class does not exist
function my_plugin_init() {
$option = new scbOptions( 'my_plugin' ); // OK
...
}
scb_init( 'my_plugin_init' );
This method is recommended when you plan to use scbFramework on a site that you control.
- Move the scbFramework folder to
wp-content/mu-plugins/scb
(create the directories as needed). - Copy the scb-load.php file into
wp-content/mu-plugins/
.
Now, all the classes are available to all plugins and themes. For example, in your theme's functions.php
file you can write:
<?php
$my_theme_options = new scbOptions( 'my_theme_options' );