Forums

Getting the amended contents of a post (2 posts)

  1. brickhill
    Member
    Posted 2 years ago #

    Perhaps somebody could help me with a small problem I am having.

    I am writing my first stab at a plugin and have a new panel on the post editor screen.

    What I want to happen is when a button on my panel is pressed, I need to grab the current contents of the post - i.e. including any changes that have been made to the content.

    I have tried using $post->post_content but this only returns me the value of the post on the database (i.e. without the current amendments). I have also tried using jQuery : jQuery('#content').val() but this does the same.

    Any advice would be most appreciated.

  2. liuchangjun
    Member
    Posted 2 years ago #

    str_replace("\r\n","<br />",$item->post_content)
    replace the newline with HTML tags.

Topic Closed

This topic has been closed to new replies.

About this Topic