[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

oika_oik_ajax_do_shortcode() – Expand the chosen shortcode in the required context

You appear to be a bot. Output may be restricted

Description

Expand the chosen shortcode in the required context

Paginated content can be created by a number of different shortcodes. Smart shortcodes are able to determine what they need to do from the current context. Normally this involves obtaining post information from the global post object. We need to load the selected post in order to be able to do this. Security checking – can the user view the post? – should continue to be performed

Usage

oika_oik_ajax_do_shortcode();

Parameters

Returns

void

Source

File name: oik-ajax/oik-ajax.php
Lines:
1 to 49 of 49
function oika_oik_ajax_do_shortcode() {
  bw_trace2();
  do_action( "oik_add_shortcodes" );
  //bw_trace2( $_REQUEST, "_REQUEST" );
  $shortcode = urldecode( bw_array_get( $_REQUEST, "shortcode", null ) );
  
  $post_id = bw_array_get( $_REQUEST, "post", null ); 
  
  $post = oika_get_post( $post_id );
  
  $link = bw_array_get( $_REQUEST, "link", null );
  $bwscid = bw_array_get( $_REQUEST, "bwscid", null );
  
  bw_trace2( $shortcode, "shortcode", false );
  //$shortcode = oika_alter_shortcode( $shortcode, $link, $bwscid );
  
  $_SERVER['REQUEST_URI'] = $link;
  $page = oika_get_page_from_link( $link, $bwscid );
  
  // Pretend that the shortcode being paged is the first one in the 'content'
  // Does this work for shortcodes in widgets?
  //
  //$_REQUEST["bwscid$bwscid"] = $page;
  $_REQUEST["bwscid1"] = $page;
  
  $content0 = bw_array_get( $_REQUEST, "content0", null );
  if ( $content0 ) {
    $shortcode_content = oika_fetch_shortcode_content( $post, $shortcode, $content0 );
    
    $result = bw_do_shortcode( $shortcode_content );   // bw_do_shortcode( "[$shortcode]$content[/$shortcode]" );   
  
  } else { 
    $result = bw_do_shortcode( "[$shortcode]" );
  }
  
  //$content = bw_array_get( $_REQUEST
  //echo $result;
  $json_response = array( "result" => $result
                        , "page" => $page
                        , "link" => $link
                        );
          
  $response = json_encode( $json_response ); 
  echo $response;
  bw_trace2( $response, "response", false );
  die();

}
 
 View on GitHub

Published: December 18, 2017 | Last updated: December 18, 2017

Information

Function name: oika_oik_ajax_do_shortcode
Plugin ref: oik-ajax
Version: 0.0.1
Sourcefile: oik-ajax.php
File ref: oik-ajax.php
Deprecated?: No
API Letters: A,D,O,S

Recent plugin updates

oik v4.7.2 oik v4.7.2 includes a fix to the logic to render blocks for Content and Excerpts in the bw_pages shortcode. ...
oik v4.7.1 Upgrade to oik v4.7.1 for bw_pages rendering blocks for Content and Excerpts, and support for post_name attribute for shortcode which query posts ...
oik-shortcodes v1.41.1 Upgrade to oik-shortcodes v1.41.1 for a couple of minor changes. ...
oik-bob-bing-wide v2.2.2 Upgrade to oik-bob-bing-wide v2.2.2 for improvements to bw_dash examples and fixes to some SVG icon's visibility. ...
oik-bwtrace v3.3.1 Upgrade to oik-bwtrace v3.3.1 to measure plugin load times and ad hoc action timing points. ...

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: [email protected]

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


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