[wp-trac] [WordPress Trac] #33096: Don't use hidden #post_ID input field to get mce-view embed postID

WordPress Trac noreply at wordpress.org
Thu Jul 23 13:27:34 UTC 2015


#33096: Don't use hidden #post_ID input field to get mce-view embed postID
--------------------------+-----------------------------
 Reporter:  rhurling      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  4.2.2
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+-----------------------------
 The mce-view embeds use `postID = $( '#post_ID' ).val() || 0` to get the
 ID of the current post (see
 https://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/mce-
 view.js#L731).
 Everything else I could find used `wp.media.view.settings.post.id`.

 I think it would be better to either use `wp.media.view.settings.post.id`
 in the callbacks that use the current postID variable or switch to
 something that is localized to the script (brought up by @iseulde;
 https://wordpress.slack.com/archives/core-editor/p1437654722000160).

 I will add a patch which uses `wp.media.view.settings.post.id`, because
 I'm not sure what else I would have to change to use a localize the
 script.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33096>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list