[wp-hackers] shortcodes, BR tags and feed/XML-RPC interfaces

ravi ravi-lists at g8o.net
Tue Sep 8 21:28:36 UTC 2009

On Sep 4, 2009, at 11:40 PM, Joseph Scott wrote:
> I would say that the feed should contain the expanded HTML of the
> short code and not the raw short code itself.  For XML-RPC though the
> raw short code should be returned, not the expanded HTML.

My bad. The behaviour is indeed as above, on second look i.e., feed  
has shortcodes expanded and XML-RPC does not. Which I agree is the way  
it should be. Back to my other two issues:

a) Why a <br /> tag at the end of lines within the shortcode? Is this  
wpautop() doing this? Is that a bug?

b) Any suggestions on how I might be able to retain the shortcode in  
the text (in the DB, so that the shortcode content can be edited  
later) but have it expanded in the XML-RPC interface? I suppose I  
would need to use actions in a plug-in (not my theme) to accomplish  
this, if at all. Any pointers on the actions/filters I should be  
looking at?

Thank you,


> On Fri, Sep 4, 2009 at 9:27 AM, // ravi<ravi-lists at g8o.net> wrote:
>> Also, one shortcoming of my quick and dirty trick seems to be that  
>> though my
>> splendid FancyBox gallery is rendered correctly in the browser,  
>> when the
>> content is pulled via the feed or XML-RPC the shortcode is left as- 
>> is --
>> which is understandable I guess since the theme only applies to  
>> browser
>> rendering. Is this correct? i.e., there is no way for me, in my  
>> theme code,
>> to enable shortcode expansion for post content for feeds and XML-RPC?
>> One way to overcome this may be to add an action or filter, which  
>> would
>> entail (if I am getting it right) the creation of a plugin. I do  
>> not want
>> the plugin to modify the content as it is saved i.e., I do not want  
>> it to
>> hook into the post editing function. That would cause the shortcode  
>> to be
>> expanded/replaced on saving, preventing future edits. I could  
>> instead, I
>> hope, add a filter that would kick in when the content is accessed
>> (irrespective of the reason/means of access, whether it be for  
>> rendering in
>> browser, or for feed or XML-RPC).
>> Any suggestions, comments or advice would be great. Thank you,

More information about the wp-hackers mailing list