You appear to be a bot. Output may be restricted
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