humanmade/atception

Name: atception

Owner: Human Made

Description: Yo dawg I heard you like attachments so I made a plugin that lets you attach attachments to your attachments

Created: 2015-02-21 14:19:51.0

Updated: 2015-07-14 21:40:47.0

Pushed: 2015-02-21 15:36:43.0

Homepage: null

Size: 152

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Atception

Yo dawg I heard you like attachments so I made a plugin that lets you attach attachments to your attachments

Wat?

In all seriousness sometimes it can be useful to have a method of connecting alternative media files to other media files. Take the following examples:

Note: this a developer tool - it only provides the admin UI and a function for retrieving the alternative media.

Admin UI

How to use it
Register a connection

hm_register_alt_media( $key, $label, $mime_type [, $alt_mime_type = 'image' [, $multiple = false ] ] )

p

dd thumbnails to videos
egister_alt_media( 'video_thumb', __( 'Video thumbnail' ), 'video' );


Unregister a connection

hm_unregister_alt_media( $key )

p

emove thumbnails from videos
nregister_alt_media( 'video_thumb' );


Get attached files

hm_get_alt_media( $attachment_id, $key, [, $fields = 'ids' ] )

p

et thumbnails to videos
mb = hm_get_alt_media( 123, 'video_thumb' );
 wp_get_attachment_image( $thumb, 'medium' );


Contributing

All suggestions and ideas are welcome, just add an issue!


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.