You appear to be a bot. Output may be restricted
Description
Expand the chosen shortcode in the required contextPaginated 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
voidSource
File name: oik-ajax/oik-ajax.phpLines:
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