oikai_set_context() – Set/reset the context fields for this function

You appear to be a bot. Output may be restricted

Description

Set/reset the context fields for this function

Processing depends on the $value When it's an action hook or filter invocation then we set "hook" When it's an association of a function to a hook then we set "add_" When null we reset fields Otherwise we set the "literal" Notes: This can't handle nested filters / hooks

Usage

oikai_set_context( $value );

Parameters

$value
( string ) optional – the hook invoker, the hook association method, null or a literal

Returns

void

Source

File name: oik-shortcodes/shortcodes/oik-api-importer.php
Lines:

1 to 33 of 33
function oikai_set_context( $value=null ) {
  switch ( $value ) {
    case "apply_filters":
    case "apply_filters_ref_array":
    case "do_action":
    case "do_action_ref_array":
      bw_context( "hook", $value ); 
      bw_context( "add_", false );
      bw_context( "operator", false );
      bw_context( "variable", false );
      bw_context( "dummy_TCES", false );
      break;
      
    case "add_action":
    case "add_filter": 
      bw_context( "hook", false );
      bw_context( "add_", $value );
      bw_context( "operator", false );
      bw_context( "variable", false );
      break;
      
    case null:
      //br( "setting hook and add_ to false ");
      bw_context( "hook", false );
      bw_context( "add_", false );
      bw_context( "operator", false );
      bw_context( "variable", false );
        
    default:
      bw_context( "docblock", false );
      bw_context( "literal", $value );
  }   
}