You appear to be a bot. Output may be restricted
Description
Set/return some contextual informationContextual information such as the current post_type, shortcode being expanded, $atts for the shortcode being expanded can be made accessible using this API. It saves passing complex parameters. The data can be accessed within filter and action functions.
Usage
$mixed = bw_context( $field, $value );
Parameters
- $field
- ( string ) required – the name of the field
- $value
- ( mixed/null ) optional – the value of the field. It could be anything. Don't pass a parameter when querying a value
Returns
mixed the $value of the contextual fieldSource
File name: oik-bwtrace/libs/bobbfunc.phpLines:
1 to 13 of 13
function bw_context( $field, $value=null ) { static $bw_context = null; if ( empty( $bw_context ) ) { $bw_context = array(); } if ( $value !== null ) { $bw_context[$field] = $value; } else { $value = bw_array_get( $bw_context, $field, null ); } // bw_trace2( $bw_context ); return( $value ); }View on GitHub View on Trac