[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

oiksc_ajax_oiksc_create_api() – Implement "wp_ajax_oiksc_create_api" action for oik-shortcodes

You appear to be a bot. Output may be restricted

Description

Implement "wp_ajax_oiksc_create_api" action for oik-shortcodes

The API may contain the API name in the format of 'class::api' – representing a method 'api' – representing a function 'class::' – representing a class The value we store in "_oik_api_name" for a method will be in the class::api format API names are normally expected to be unique. This code does not cater for use of namespacing.

Usage

oiksc_ajax_oiksc_create_api();

Parameters

Returns

void

Source

File name: oik-shortcodes/oik-shortcodes.php
Lines:
1 to 47 of 47
function oiksc_ajax_oiksc_create_api() {
  do_action( "oik_loaded" );
  
  // Enabling autoloading requires oik v3.0.0-beta.xxxx or higher
  oiksc_autoload();
  // User still has to be authorised to perform the request!
  // So how do we check this?
  //oiksc_create_api();
  global $plugin_post, $plugin;
  
  $type = bw_array_get( $_REQUEST, "type", null );
  $api = bw_array_get( $_REQUEST, "api", null );
  $file = bw_array_get( $_REQUEST, "file", null );
  $plugin = bw_array_get( $_REQUEST, "plugin", null );
  $title = bw_array_get( $_REQUEST, "title", null );
  // We don't need the $type **?**
  if ( $api && $file ) {
    oik_require( "includes/bw_posts.php" ); 
    oik_require( "admin/oik-apis.php", "oik-shortcodes" );
    oik_require( "admin/oik-shortcodes.php", "oik-shortcodes" );
    oik_require( "feed/oik-plugins-feed.php", "oik-plugins" );
    oik_require( "shortcodes/oik-api-importer.php", "oik-shortcodes" );
    if ( is_null( $plugin )) {
      $plugin = 'wordpress';
      //$file = ABSPATH . $file;
      //$file = str_replace( "\\", "/", $file );
      bw_trace2( $file, "file" );
    } 
    $component_type = oiksc_query_component_type( $plugin );
    $plugin_post = oiksc_load_component( $plugin, $component_type );
    if ( $plugin_post ) {
      $func = oikai_get_func( $api, null ); 
      if ( $func ) {
        $post_id = _oiksc_create_api( $plugin_post->ID, $api, $file, $type, $title ); 
      } else {
        $post_id = oikai_get_classref( $api, null, $plugin_post->ID, $file );
      }
    } else {
      e( "Invalid plugin: $plugin ");
    }    
  } else {
    bw_trace2();
    e( "missing stuff :$api:$file:$plugin:" );
  }
  bw_flush(); 
  exit();    
}
 
 View on GitHub

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

Information

Function name: oiksc_ajax_oiksc_create_api
Plugin ref: oik block shortcode and API server
Version: 1.41.1
Sourcefile: oik-shortcodes.php
File ref: oik-shortcodes.php
API type: action
Deprecated?: No
API Letters: A,C,O

Recent plugin updates

UK-tides v3.1.1 UK-tides v3.1.1 is built with the latest wp-scripts. It's been tested with WordPress 6.2 and Gutenberg 15.7.0 ...
oik-weight-zone-shipping v0.2.6 oik-weight-zone-shipping v0.2.6 has been tested with WooCommerce 7.4.0. ...
sb-chart-block v1.2.3 SB Chart Block v1.2.3 contains a fix for an Uncaught Error: Call to undefined function bw_trace2()  ...
SB Chart Block v1.2.1 Update to SB Chart Block v1.2.0 for custom colors, font size options and multiple y-axis charts.  ...
oik-css v2.1.0 Update to oik-css v2.1.0 for the ability to style CSS and GeSHi output in documentation. ...

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.2.2. PHP: 7.4.33. Memory limit: 768M