If a function echo
s data, you can use php output buffering to capture the echo
ed output and return it instead
// Turn on the output buffer
ob_start();
// Echo the editor to the buffer
wp_editor();
// Store the contents of the buffer in a variable
$editor_contents = ob_get_clean();
// Return the content you want to the calling function
return $editor_contents;
Related Posts:
- How to add multiple buttons to TinyMCE?
- TinyMCE popup windows using WP functions
- How to prevent tinymce macro from inserting nbsp;?
- Tinymce shortcodes within shortcode contents
- TinyMCE get selected text and underlying HTML
- Is it possible to add a repeater field to TinyMCE’s option window?
- How do I preview the result of a shortcode in the TinyMCE editor?
- Tinymce list of shortcodes button
- How to type shortcode-like text in WordPress TinyMCE visual editor?
- Preserve shortcode content formatting
- Custom Shortcode: define cursor position/insertion point?
- Documentation for adding a tinyMCE view for visual live preview of custom shortcode?
- How to prevent shortcode preview from breaking in tinymce editor?
- wp_editor in thickbox
- How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
- Placing tags on wordpress visual editor using shortcodes
- Pass data back to TinyMCE from Thickbox
- Shortcode from admin textarea to page
- tinymce custom button
- Why can’t I type [ ] opening and closing brackets on the Visual tab?
- Output html source tags inside shortcode
- How to print [embed] code in wordpress [duplicate]
- What makes a placeholder resizable in Tinymce?
- Identifying first and last instance of shortcode in post
- How to create a shortcode with 1 parameter (atts)
- shortcodes output before content [duplicate]
- Create custom [sourcecode] shortcode, the right way?
- TED talks shortcode not working
- What is the best way to enable nested shortcodes?
- how do you get the author’s username?
- do_shortcode inside AJAX callback
- shortcode_unautop shortcode not functioning
- Shortcode perfomance solution
- How can I run shortcode after click with ajax
- Execute shortcode within shortcode
- How to create a shortcode to display a category description?
- shortcode not working and the relation to the_content()
- How to enqueue script based on post category?
- Disable oEmbed for a Single Shortcode or at Least All Internal Links
- Extending Shortcode attributes
- Shortcode But Without The Equals Sign?
- shortcodes between square and curly brackets
- How to Get a part of URL and put in shortcode?
- Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?
- get_shortcode_regex() only matches first shortcode
- Looking for a way to include/embed text from a file on a page so that the short codes are processed
- How do I debug a short code?
- Does registering multiple shortcodes impact performance?
- How can I hide the Permalink/Shortlink for certain user logged in Users of a certain level?
- How to force that styles are enqueued in the header?
- add action only if gallery shortcode attribute is equal to?
- How To Conditionally Include A Short Code Depending On The HTTP_REFERER [closed]
- Create shortcode in WordPress, using one variable in 3 functions?
- Adding javascript actions to words in post content
- My shortcode does not call the function
- Hide Selection of Text From Archive, but Show on Single Posts
- How to create an incremental list using shortcodes?
- Do shortcode that is inserted in a textarea is not displaying properly
- How to Make Archive ShortCode
- Adding custom form within add_shortcode
- wp_editor not rendering the shortcode
- Default WordPress shortcodes not working?
- how to add shortcode in wordpress container [duplicate]
- How to make this shortcode work for post content wordpress [duplicate]
- stop WordPress removing shortcode from content [closed]
- caption shortcode using image alt as caption
- Is there a good way to load tiny_mce_popup.js through editor.windowManager.open?
- Is it possible to handle two or more shortcodes in a single page?
- Toggle Shortcode Sanitize Title
- Clearfix Shortcode
- How and when to include shortcode source files
- Use full size images in a specific gallery
- How to deal with WordPress bug: can’t use wrapped and unwrapped shortcode on same post
- Execute Shortcodes when submitting post
- Substituting value via shortcode
- Create shortcode for each form field in contact form 7
- Auto embeds don’t work for attachment descriptions
- Shortcode to appear and show the date not code in Title and description of Social Media sites
- how to add shortcode widget at end of main blog page
- Shortcode result appears above page content
- Shortcode is not showing content when placed in editor (post_type = page)
- How to set up posts per page on WP
- How to insert a short code into Contact Form 7 in WordPress that will call a function once the submit button is pressed
- Unable to make shortcode, what is wrong?
- Multiple shortcodes only use attributes from one of the shortcodes on custom plugin
- How do i remove Business feeds Shortcode fatal error
- Push Shortcode parameter to template
- latest posts shortcode with image
- Featured image with link to post shortcode, image displaying above the post
- Video shortcode inside tabs shorcode NOT working
- How to stop unwanted splits in excerpts when using shortcodes for sliders or players
- How to add meta slider lite or other slider to main page header in pinboard theme
- Str_replace using shortcode with multiple changes
- Escaping a shortcode so it displays as-is [duplicate]
- WordPress do_shortcode first iteration
- Add a short code to a plugin
- Applying if (get_post_meta) to new shortcode
- Add widget/shortcode to sidebar OUTSIDE of the theme
- How to remove https:// from shortcode generated url
- 3 shortcodes 2 won’t render [closed]