You appear to be a bot. Output may be restricted
Description
Load the callback function for a virtual fieldExample, the _oik_sc_the_title_cb virtual field is themed by the
callback function bw_get_shortcode_expands_in_titles()
which is implemented in "#file" => "shortcodes/oik-codes.php" from "#plugin" => "oik"Usage
$string = bw_load_callback( $field );
Parameters
- $field
- ( array ) required – the definition of the field
Returns
string the callback name if successfully loadedSource
File name: oik-fields/includes/oik-fields.incLines:
1 to 16 of 16
function bw_load_callback( $field ) { $args = $field['#args']; $callback = bw_array_get( $args, "#callback", null ); if ( !is_callable( $callback ) ) { $file = bw_array_get( $args, "#file", null ); $plugin = bw_array_get( $args, "#plugin", null ); $path = oik_path( $file, $plugin ); if ( file_exists( $path ) ) { oik_require( $file, $plugin ); } if ( !is_callable( $callback ) ) { $callback = "Missing callback for field"; } } return( $callback ); }View on GitHub