You appear to be a bot. Output may be restricted
Description
Return an API name from the dummy_TCESThe API name is the concatenation of the tokens with "::"s separating them We really don't expect any more than two tokens to have been saved AND if it's only one then we remove the leading "::"
Usage
$string = oikai_concoct_api_name2( $tokens );
Parameters
- $tokens
- ( array ) required – the tokens
Returns
string $hook_name – which may be ''Source
File name: oik-shortcodes/shortcodes/oik-api-importer.phpLines:
1 to 18 of 18
function oikai_concoct_api_name2( $tokens ) { $TCESes = bw_context( "dummy_TCES" ); //bw_trace2( $TCESes, "TCESes", false ); $api_name = ''; if ( is_array( $TCESes) && count( $TCESes ) ) { foreach ( $TCESes as $TCES ) { //bw_trace2( $TCES, "TCES", false ); if ( is_array( $tokens[$TCES] ) ) { $api_name .= "::" . trim( $tokens[$TCES][1], "\"'" ); } } } bw_trace2( $api_name, "api_name", false, BW_TRACE_DEBUG ); $api_name = ltrim( $api_name, ":" ); bw_trace2( $api_name, "API_name", false, BW_TRACE_VERBOSE ); return( $api_name ); }View on GitHub