Skip to content

Instantly share code, notes, and snippets.

@dknauss
Created April 10, 2015 23:15
Show Gist options
  • Select an option

  • Save dknauss/db442ba3546663c201ca to your computer and use it in GitHub Desktop.

Select an option

Save dknauss/db442ba3546663c201ca to your computer and use it in GitHub Desktop.
Hack the flickr-pick-a-picture plugin media button to work like unsplash-wp
/**
* Adds the pick a pic icon to the media bar.
*
* @param it editor_id.
* @return noting.
**/
function pac_pickapic_media_buttons($editor_id = '') {
echo '<a href="#TB_inline?width=1200&height=800%&inlineId=popup_container"
class="button thickbox unsplash" title="Flickr - Click photos to upload directly to your media library"
// id="' . esc_attr( $editor_id ) . '-add_media" title="' . esc_attr__( 'Flickr', 'pickapic' ) . '" onclick="return false;">
<span class="dashicons dashicons-camera"></span> Flickr</a>';
}
add_action( 'media_buttons', 'pac_pickapic_media_buttons', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment