Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Overload wp.media.editor.send to send linkto and linkUrl fields #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Dec 2, 2015

  1. Overload wp.media.editor.send to send additional fields

    Based off code by @vralle at https://gist.github.com/vralle/b0db1083f1c8e392527e
    
    I wanted a way to tap into the `wp.media.editor.send.attachment`
    functionality which didn't completely break the connection to core's
    functionality. This is the best I could come up with for now -
    temporarily redefining the ajax method so that the post data can be
    modified before posting to admin-ajax.
    
    The benefits of this approach over just copy-pasting the
    `wp.media.editor.send.attachment` functionality from core are that:
    * we're not preventing other plugins from also tapping into this method
    * we don't cut ourselves off from core's functionality, so that if this
      method is updated in core, we still get to use the core function; just
      temporarily interrupted at the stage of posting.
    goldenapples committed Dec 2, 2015
    Configuration menu
    Copy the full SHA
    d31d1af View commit details
    Browse the repository at this point in the history
  2. Fix "Link to" select values that are inconsistant w/core

    In the media editor, `linkto="post"` is the value for "Link to Attachment
    Page". In the shortcode UI, we call that value `linkto="attachment"`.
    This converts the values that might be returned by media-send-to-editor
    to the values we want to use in the shortcode. Props @vralle.
    goldenapples committed Dec 2, 2015
    Configuration menu
    Copy the full SHA
    55159df View commit details
    Browse the repository at this point in the history
  3. Fix PHPCS violation

    Each line in an array declaration must end in a comma.
    goldenapples committed Dec 2, 2015
    Configuration menu
    Copy the full SHA
    c136fba View commit details
    Browse the repository at this point in the history