get( 'any-ipsum-oembed-request' ) === '1' ) { $this->handle_oembed_request(); } } private function handle_oembed_request() { $url = WPAnyIpsumCore::get_request( 'url' ); if ( ! empty( $url ) ) { $html = $this->build_html( apply_filters( 'anyipsum-generate-filler', apply_filters( 'anyipsum-parse-request-args', $url ) ) ); $oembed = new stdClass(); $oembed->type = 'rich'; $oembed->html = $html; $oembed->provider_name = 'Bacon Ipsum'; $oembed->version = '1.0'; $oembed->provider_url = 'http://baconipsum.com'; wp_send_json( $oembed ); } } private function build_html( $paras ) { $html = ''; for ( $i=0; $i < count( $paras ); $i++ ) $html .= '
' . $paras[$i] . '
'; return $html; } } }