Skip to content

Commit

Permalink
documentation for runnable option type
Browse files Browse the repository at this point in the history
  • Loading branch information
llemurya committed Mar 26, 2015
1 parent 84c4217 commit 9336adf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions options/built-in-option-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1011,3 +1011,31 @@ Google maps location.
'desc' => __('Description', 'fw'),
'help' => __('Help tip', 'fw'),
)
Runnable
----------
Run a script on button click.
.. code-block:: php
array(
'type' => 'runnable',
'value' => 'This script have no runs',
'label' => __( 'Label', 'fw' ),
'desc' => __( 'Description.', 'fw' ),
'help' => __( 'Help tip', 'fw' ),
/**
* Button text
*/
'content' => __( 'Run this script' ),
/**
* Callback that will run, there are 3 types :
* function callback - array('callback_function'), ex: array('wp_list_categories'),
* unyson callback - array('extension_name', 'callback_function'), ex: array( 'seo-sitemap', 'update_sitemap' ),
* static class method array('class_name', 'callback_function')
* note that object method call don't work, wrap it in a function or write it in extension.
*/
'callback' => array('wp_list_categories')
)

0 comments on commit 9336adf

Please sign in to comment.