/** * Renders shortcodes in the TinyMCE. * * This is the AJAX callback for rendering shortcodes to be previewed in the TinyMCE editor. * * @since 1.0.0 */ public static function render_shortcodes() { global $render_shortcode_data, $Render, $content; define('RENDER_TINYMCE', true); $render_shortcode_data = $_POST['shortcode_data']; $content = stripslashes($_POST['content']); // Remove any disabled shortcodes foreach (render_get_disabled_shortcodes() as $code) { $Render->remove_shortcode($code); } /** * Allows hooking into the tinymce AJAX rendering call. * * Plugins may find this useful to globalize data for their tinymce shortcode callback. * * @hooked $this->render_ajax() 1 * * @since 1.0.0 */ do_action('render_tinymce_ajax'); /** * Log out for TinyMCE display purposes. * * @since 1.0.0 */ if (apply_filters('render_tinyme_logged_out', false)) { render_tinyme_log_out(); } $pattern = get_shortcode_regex(); $content = render_strip_paragraphs_around_shortcodes($content); $content = preg_replace_callback("/{$pattern}/s", array(__CLASS__, '_replace_shortcodes'), $content); echo $content; die; }
/** * TinyMCE version. * * Logs out the user before displaying form. * * @since 1.0.0 * * @param array $atts The attributes sent to the shortcode. * * @return string The HTML login form */ function _render_sc_login_form_tinymce($atts = array()) { render_tinyme_log_out(); return _render_sc_login_form($atts); }