• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

[oik] plugins.com

WordPress plugins and themes

  • 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

oik_wp_loaded() – Bootstrap logic for oik-wp

You appear to be a bot. Output may be restricted

Description

Bootstrap logic for oik-wp

The checks if we're running as "CLI" -Command Line Interface

  • If we are then we prepare the batch environment
  • then, if this file is the first file we run the routine specified on the command line
  • or, if it's being run under PHPUnit then we load the unit test environment for the tests that will follow

Usage

oik_wp_loaded();

Parameters

Returns

void

Source

File name: oik-batch/oik-wp.php
Lines:
1 to 56 of 56
function oik_wp_loaded() {
  if ( PHP_SAPI == "cli" ) {
    if ( defined( 'WP_CLI' ) && WP_CLI ) {
      // This is WP-CLI, so we don't do anything.
    } else {
      oik_batch_load_lib( "oik-cli" );
      oik_batch_merge_argv();
      oik_batch_start_wordpress();
      
      /*
			 * The plugin may decide to run itself automagically
			 * This code is probably all rubbish now!
			 */
      //echo "I got here" . PHP_EOL;
      //echo "oik-wp running WordPress 
      echo getcwd() . PHP_EOL;
      
      oik_batch_debug();
      //oik_batch_trace( true );
      
      //oik_batch_define_constants();	 // @TODO Not necessary in oik-wp since WordPress has done all of this! 
      oik_batch_load_oik_boot();
      //oik_batch_simulate_wp_settings();
      //oik_batch_load_wordpress_files();
      //oik_batch_load_cli_functions(); 
      echo PHP_SAPI;
      echo PHP_EOL;
      $included_files = get_included_files();
      if ( $included_files[0] == __FILE__) {
         oik_batch_run();
      } else {
        if ( false !== strpos( $_SERVER['argv'][0], "phpunit" ) ) {
          // This is PHPUnit
          oik_batch_load_wordpress_develop_tests();
        }
      }
      // wp-batch has been loaded by another PHP routine so that routine is in charge. e.g. boot-fs.php for WP-CLI
      //echo "who's in charge?" . PHP_EOL;
    }
  } else {
    //echo PHP_SAPI;
    //echo PHP_EOL;
    if ( function_exists( "bw_trace2" ) ) {
      bw_trace2( PHP_SAPI, "oik-wp loaded in WordPress environment?" );
    }
    if ( function_exists( "add_action" ) ) {
      // if ( bw_is_wordpress() ) {
      
      oik_batch_load_lib( "oik-cli" );
      oik_batch_load_oik_boot();
      add_action( "admin_notices", "oik_batch_activation" );
      add_action( "oik_admin_menu", "oik_batch_admin_menu" );
      //add_action( "@TODO load shared libraries?
    } 
  }
}
 
 View on GitHub

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

Primary Sidebar

Information

Function name: oik_wp_loaded
Plugin ref: oik-batch
Version: 1.0.0
Sourcefile: oik-wp.php
File ref: oik-wp.php
Deprecated?: No
API Letters: L,O,W

Recent plugin updates

oik-fields v1.55.1
oik-fields v1.55.1 oik-fields v1.55.1 has been tested with WordPress 7.1. ...
oik v4.16.0
oik v4.16.0 Upgrade to oik v4.16.0 for many accessibility (a11y) improvements for both the front end and admin areas, plus a security fix. ...
oik-fields v1.55.0
oik-fields v1.55.0 Upgrade to oik-fields v1.55.0 for accessibility improvements to the featured image virtual field. ...
oik-css v2.4.0
oik-css v2.4.0 Upgrade to oik-css v2.4.0 for accessibility improvements for Low Color Contrast errors. ...
oik-unloader v0.4.0
oik-unloader v0.4.0 Update to oik-unloader v0.4.0 for improved accessibility of the active-plugins shortcode. Tested with WordPress 6.9 and PHP 8.4 ...

Footer

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-2026. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins

WordPress version: 7.1.2

Gutenberg version: 24.0.0

PHP version: 8.2.35