[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

oikai_handle_token_T_STRING() – Handle a T_STRING token

You appear to be a bot. Output may be restricted

Description

Handle a T_STRING token

Identifiers, e.g. keywords like parent and self, function names, class names and more are matched as T_STRING tokens. We treat just about every string as a possible function name. So first of all we concoct the name that it could be using recently handled tokens. We use oikai_determine_function_type() to find out if the API is a PHP function ( "internal" ) or one we might recognise or one of WordPress'es. If it's one of ours then we'll also record the fact that this function calls this API.

Usage

$ID = oikai_handle_token_T_STRING( $key, $token, $tokens, $doaction );

Parameters

$key
( mixed ) required –
$token
( mixed ) required –
$tokens
( mixed ) required –
$doaction
( bool ) optional default: 1 – whether or not to invoke the action that adds this as a called function.

Returns

ID post_id of the API if it's one of ours, or null

TO DO

But should this alter the context? $value = $post_id; ? At the end of processing we reset the context.

Source

File name: oik-shortcodes/shortcodes/oik-api-importer.php
Lines:
1 to 41 of 41
function oikai_handle_token_T_STRING( $key, $token, &$tokens, $doaction=true  ) {
  bw_trace2( null, null, true, BW_TRACE_VERBOSE );
  $post_id = null;
  if ( is_array( $token ) ) {
    $value = $token[1];
  } else { 
    $value = $token;
  } 
  oik_require( "shortcodes/oik-apilink.php", "oik-shortcodes" );
  $api_name = oikai_concoct_api_name( $value );
  //br( "handle T_STRING,$value,$key,$api_name," ); 
  $type = oikai_determine_function_type( $api_name );
  switch ( $type ) {
    case 'internal':
      $tokens[$key][3] = oikai_link_to_php( $api_name );
      $post_id = null;
      break;

    case 'oik_api':
    case 'oik_class':
    case 'oik_file':
    case 'oik_hook':
      $wordpress_cache = oiksc_load_wordpress_cache();
      $tokens[$key][3] = $wordpress_cache->get_wordpress_link( $api_name );
      break;

    default:

    if ( is_multisite() ) {
      $post_id = oikai_pragmatic_link_to_api( $key, $tokens, $api_name, $doaction, $type );
    } else {
      $post_id = oikai_link_to_local_site( $key, $tokens, $api_name, $doaction, $type, $value );
    }

  }
  if ( $doaction ) {
    //br( "calling set_context with !$value! !$post_id!" );      
    oikai_set_context( $value ); 
  }  
  return( $post_id ); 
}
 
 View on GitHub

Published: March 11, 2017 | Last updated: March 11, 2017

Information

Function name: oikai_handle_token_T_STRING
Plugin ref: oik block shortcode and API server
Version: 1.41.1
Sourcefile: shortcodes/oik-api-importer.php
File ref: shortcodes/oik-api-importer.php
Deprecated?: No
API Letters: H,O,S,T

Recent plugin updates

oik v4.9.2 Upgrade to oik v4.9.2 for support for PHP 8.1 and PHP 8.2. ...
oik-block v0.3.0 oik-block v0.3.0 no longer displays the Editor selection meta box ...
oik-blocks v1.4.3 Upgrade to oik-blocks v1.4.3 for PHP 8.2 support. ...
cookie-cat v1.4.6 Upgrade to cookie-cat v1.4.6 for PHP 8.1 & PHP 8.2 support. ...
oik-fields v1.54.0 oik-fields v1.54.0 caters for the deprecation of get_page_by_title() in WordPress 6.2. ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: herb@bobbingwide.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.3.1. PHP: 7.4.33. Memory limit: 768M