Hooks/Action Reference/builder start

From IThemes Codex
Revision as of 09:37, May 10, 2011 by Gaarai (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Description

This action hook is called when the Builder code stack first starts to run. It isn't used by Builder or any of the Builder plugins.

Possible Uses

The main reason for this hook is for other code to use it as an init hook that only runs when Builder is active. This could be useful if the feature is only valuable when used with Builder or if the code would break if Builder isn't present.

Parameters

None

Example Use

This is an example plugin's main file that is used to load the rest of the plugin code when the builder_start action fires.

To try out the example, create a new plugin directory at wp-content/plugins, such as wp-content/plugins/builder-example-plugin, and add two empty files to the directory: init.php and features.php.

<?php
/*
Plugin Name: Builder Example Plugin
Plugin URI: http://ithemes.com/
Description: Example plugin that shows how plugin features can be loaded only when the Builder theme is active.
Author: Chris Jean
Version: 1.0.0
Author URI: http://chrisjean.com/
*/


// The bep_ prefix is used to stand for "Builder Example Plugin" and helps
// prevent name collisions with other plugins.
function bep_init() {
    require_once( dirname( __FILE__ ) . '/features.php' );
}
add_action( 'builder_start', 'bep_init' );

You can download this example plugin here.


Back to Builder Hooks

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox