The div #editorcontainer
contains a regular textarea #content
and an iframe #content_ifr
.
The #content
is filled with the saved contents of the post when the page loads. This means that any live edits of the content won’t be returned when calling jQuery("#content").html()
. For the same reason, you get an empty string in the case of a new post.
Where you really need to look for the live updated contents is in the iframe, which is used by the WYSIWYG editor. Here’s how:
jQuery('#content_ifr').contents().find('#tinymce').html();
Also see: jquery/javascript: accessing contents of an iframe.
Related Posts:
- Stop WordPress Wrapping Images In A “P” Tag
- Stop WordPress automatically adding tags to post content
- Get content from one page and show it on another page
- Confirmation box when submitting post for review
- Ajax Load More Posts in Category Page
- Strategy for handling hierarchical pages with empty parent content
- How to remove Nextpage tag inside posts text depending of utm_campaign
- How can you make sure authors’ posts are longer than 250 words?
- Dynamically update post title in admin page
- What is the best / efficient way to get WordPress content by post id and why?
- JSON not valid after json_encode posts
- Getting an alphabetic post list with two letters onclick on letter
- How to load post content on index page using ajax when post title in sidebar is clicked
- Add default content to post (for specific category)
- Programmatically inserting page breaks
- Hide parts of the post content on the home page
- Paragraphs removed when using get_post_custom()?
- Load post content into div with ajax
- POST from jQuery to PHP
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- “Uncaught SyntaxError: Unexpected token
- Add confirmation popup on “Move to Trash”
- Same content shared between multiple posts?
- The correct way to call posts with ajax
- How do I use Ajax to show the new posts realtime, on the frontpage
- how load content as pop-up using ajax
- How to get only text from wordpress post content?
- How to create a load more post entries like Twitter?
- Disable Jquery UI post tabs
- Batch process: remove first image from post content
- jQuery inluclude still seems ncessary for script to work within post
- Why content_arr[‘extended’] removes paragraph tags?
- Ajax load more button in Recent posts widget
- Unautop / Sanitize content added to a post through a plugin
- Ajax Dynamic Archives not showing correct results
- WP_Query with ajax handler returns the same posts
- is there a way to show the the post title after the image?
- How to get rid of shortcodes in post content once and for all
- Add Word Limit to Posts
- Ajax post filters not working
- Ajaxify This Code
- Show only one page link in content pagination
- Genesis + Ajax + Jquery | Failling to call action
- Show only posts with images and a fixed amount of posts
- How do I locate the exact location where this error is occurring 404 page not found
- How to create new post content templates for my users?
- Do all wordpress themes a similar class name for content?
- How do I do a page break?
- How to get a post’s content? [closed]
- Security to delete post by Admin
- Why does a published post only displays the title and not the content in the site? [closed]
- add bootstrap post slider with tabs
- Best Way to Add UnEditable HTML to Posts
- Use Click Image to Play Youtube Video in a WordPress Loop
- The_excerpt() doesn’t parse – how to change that?
- Page and post loop same template
- Call current post URL in ajax
- the_content() Not Grabbing All Content
- Adding JS functionality to the Publish button in wp-admin/post.php
- Can’t save WordPress post with “/etc/” in it
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- Hide parts of the post content after typing it’s name or searching it by category
- How to exclude the word “class” from being matched in search?
- displaying the categories post
- Preview page/post revisions without overwriting current content
- Using the loop to set locations for all posts on a single google map
- definining own teaser text for post
- Add text and change style to post programmatically depending on category
- why my urdu text is not aligned properly when written in wordpress blog post?
- How to Remove HTML Elements from Post Excerpt?
- My website is showing today’s date instead of published date since db migration to a new wordpress
- Related post not showing table of content
- How to get unmodified post content?
- I have inserted a post’s content in homepage.php by the post-id. The font isn’t matching with the theme. How do I change font of this content?
- Many buttons not functioning in WordPress dashboard (as admin)
- How do I use slideToggle inside a wordpress post?
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Printable Page with all Posts from Tag
- Nothing appears using get_the_excerpt() in category.php
- Add caption to thumbnails in content
- Adding div to WordPress page content
- problem with creating a wordpress post slider
- How to get post_content while the post is being edited
- Problem with jQuery in post body?
- Custom template for different post types
- Correcting the content width when sidebar is inactive?
- WP Load post with ajax and apply isotope
- Multiple approval from editors before publishing?
- Run Jquery Script after delete post in front end
- Get part of a page url
- Get post id on click of thumbnail
- How can i show only 30% of the “the_content(“More…”)”?
- How to use wp_editor(); in functions.php then retrieve content in the template
- Add default content to post (for specific category)
- Stripping tag from elements in post
- Full width images within post content
- After the local installation of an old WP website I can see the homepage but I can’t access to the articles, why?
- wordpress pinboard theme [closed]
- Automatically search and replace link in content (pages/posts)?
- Notify/check if the content of a custom gutenberg block has changed on save_post