This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
plugins:creation [2014/02/07 09:16] datiswous [Hooks & Filters] |
plugins:creation [2014/02/07 09:43] datiswous [Register & Queue Your Styles] |
||
---|---|---|---|
Line 114: | Line 114: | ||
The functions in this section would be the functions that are called as part of the registration, a [[plugins:hooks_filters|hook or a filter]]. | The functions in this section would be the functions that are called as part of the registration, a [[plugins:hooks_filters|hook or a filter]]. | ||
- | <code> | + | <code php> |
# functions | # functions | ||
function hello_world() { | function hello_world() { | ||
Line 188: | Line 188: | ||
To use your script you must first register it with the system. | To use your script you must first register it with the system. | ||
- | <code> | + | <code php> |
// register_script($handle, $src, $ver, $in_footer=FALSE) | // register_script($handle, $src, $ver, $in_footer=FALSE) | ||
// $handle name for the script, must be unique for each script loaded | // $handle name for the script, must be unique for each script loaded | ||
Line 201: | Line 201: | ||
To queue and load a registered script use: | To queue and load a registered script use: | ||
- | <code> | + | <code php> |
// queue_script($name,$where); | // queue_script($name,$where); | ||
// $name name of the script to load | // $name name of the script to load | ||
Line 212: | Line 212: | ||
To register a script from your plugin folder use | To register a script from your plugin folder use | ||
- | <code> | + | <code php> |
register_script('pluginscriptname', $SITEURL.'plugins/my_plugin_folder/your.script.js', '0.1', FALSE); | register_script('pluginscriptname', $SITEURL.'plugins/my_plugin_folder/your.script.js', '0.1', FALSE); | ||
</code> | </code> | ||
Line 223: | Line 223: | ||
To use your own stylesheets you must first register them with the system. | To use your own stylesheets you must first register them with the system. | ||
- | <code> | + | <code php> |
// register_sstyle($handle, $src, $ver) | // register_sstyle($handle, $src, $ver) | ||
// $handle name for the style, must be unique for each style loaded | // $handle name for the style, must be unique for each style loaded | ||
Line 237: | Line 237: | ||
To queue and load a registered style use: | To queue and load a registered style use: | ||
- | <code> | + | <code php> |
// queue_style($name,$where); | // queue_style($name,$where); | ||
// $name name of the style to load | // $name name of the style to load |