Description
Determine the component typeComponent types supported are:
| component_type | When |
|---|---|
| wordpress | $plugin == “wordpress” |
| plugin | $plugin directory exists in WP_PLUGIN_DIR |
| theme | $plugin directory exists in WP_TEMPLATE_DIR |
Usage
$string = oiksc_query_component_type( $plugin );Parameters
- $plugin
- ( string ) required – the plugin or theme slug ( e.g. 'wordpress', 'oik', or 'genesis' )
Returns
string the component typeSource
File name: oik-shortcodes/admin/oik-apis.phpLines:
1 to 14 of 14
function oiksc_query_component_type( $plugin ) { if ( $plugin == "wordpress" ) { $component_type = "wordpress"; } elseif ( file_exists( WP_PLUGIN_DIR . "/$plugin" ) ) { $component_type = "plugin"; } elseif ( file_exists( get_theme_root() . "/$plugin" ) ) { $component_type = "theme"; } else { $component_type = null; } //echo "Component type: $component_type" . PHP_EOL; bw_trace2( $component_type, "component_type", true, BW_TRACE_DEBUG ); return( $component_type ); }View on GitHub
Called by
1 to 10 of 10
- oikai_build_apiref() – Automatically create the API reference
- oikai_load_and_reflect() – Create a dummy reflection object for the API
- oikai_oik_class_parent() – Return this class’es parent ID
- oiksc_ajax_oiksc_create_api() – Implement "wp_ajax_oiksc_create_api" action for oik-shortcodes
- oiksc_ajax_oiksc_create_file() – Implement "wp_ajax_oiksc_create_file" action for oik-shortcodes
- oiksc_get_component_by_name() – Return the component ID for the name
- _ca_doaplugin() – Create the APIs for a component
- _ca_doaplugin_local() – Create the APIs for a component
- _la_doit() – Process the selected component
- _oiksc_get_apis() – List the APIs for the selected filename
