admin_url( 'admin-ajax.php' ), '_nonce' => wp_create_nonce( NMSP_PLUGIN_NONCE ), ); wp_localize_script( 'nmsp-plugin-name-js', 'nmspPluginApi', $payload ); } /** * Display a page in place of a shortcode. * * @since 1.0.0 * * @param array $attributes Array of attributes on the shortcode string in the post body. * @param string $content (optional) Text content that is between opening and closing shortcodes. * * @return string */ public function display_custom_page( array $attributes = array(), $content = null ) { $data = array( 'shortcode' => array( 'attributes' => $attributes, 'content' => $content, ), ); ob_start(); echo nmsp_plugin_app()->blade->run( 'front.custom-page', $data ); $output = ob_get_clean(); return wp_kses_post( $output ); } } new CustomPage();