Description
Find where the class is implemented and load it
Usage
$bool = bw_list_table_loader( $class, $args );Parameters
- $class
- ( string ) required – the class name to load
- $args
- ( array ) required –
Returns
bool whether or not the class is loadedTO DO
Decide whether or not use to autoload for classes If so, determine the loading rules that will apply for all classes since we don't want hundreds of rules. Can this function actually be the spl loader function?Source
File name: oik/includes/oik-list-table.phpLines:
1 to 23 of 23
function bw_list_table_loader( $class, $args ) { if ( class_exists( $class ) ) { $loaded = true; } else { $file = str_replace( "_", "-", $class ); $file = strtolower( $file ); $plugin = bw_array_get( $args, "plugin", null ); $path = bw_array_get( $args, "path", "admin" ); $file = "${path}/class-${file}.php"; $required = array( "class" => $class , "file" => $file , "plugin" => $plugin , "args" => $args ); $required = apply_filters( "bw_list_table", $required ); // Do we need to check if the file exists? oik_require( $required['file'], $required['plugin'] ); $loaded = class_exists( $class ); } return( $loaded ); }View on GitHub View on Trac
Invoked by
Calls
1 to 2 of 2
