[wp-hackers] Extensibility and shortcodes

Andrew Ozz admin at laptoptips.ca
Wed Aug 27 20:58:48 UTC 2014


On 27/08/2014 12:10 AM, Luke Bryan wrote:
> I was looking at the wp media shortcode and wp-views, and noticed a few
> things that seem not-too-portable in the view ajax and rendering:
>
> In ajax-actions.php of Wordpress 4.0 we see this render-and-return routine
> requiring a post_id of post the user can edit:
> ...
> Why must this ajax call tie to the post-id of the post page containing the
> shortcode to be rendered?

This is meant for rendering the previews for these shortcodes in wpView, 
not for returning the HTML for arbitrary shortcodes.

As this happens only when a user is writing/editing a post, the AJAX 
action requires the post_id and checks if the current user can actually 
edit that post.



More information about the wp-hackers mailing list