[wp-trac] [WordPress Trac] #12939: Counterpart to content_save_pre hook not called when getting post content via API

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 9 15:28:41 UTC 2010


#12939: Counterpart to content_save_pre hook not called when getting post content
via API
--------------------------+-------------------------------------------------
 Reporter:  redsweater    |       Owner:  josephscott
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  Unassigned 
Component:  XML-RPC       |     Version:  2.9.2      
 Severity:  normal        |    Keywords:             
--------------------------+-------------------------------------------------

Comment(by redsweater):

 For testing purposes, you can use the syntax highlighter plugin and
 provide this literal HTML content from the web editor or from the API:

 {{{
 Testing "<

 [sourcecode]Testing "<[/sourcecode]
 }}}

 When the Syntax Highlighter plugin saves the post, it encodes the content
 inside [sourcecode] short tag. When you read the post back into the
 wordpress HTML editor, it is preserved exactly, because the plugin has the
 opportunity to decode the content back to original forma.t

 If you load the text via the API e.g. wtih getRecentPosts or with getPost,
 you end up with content:

 {{{
 Testing "<

 [sourcecode]Testing "<[/sourcecode]
 }}}

 The encoding that was done by the plugin has not been reversed.  Note well
 that this is NOT simply XML encoding that you would expect from the API.
 The literal content as it is transferred over the wire is further encoded
 and then decoded by the client.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12939#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list