Created
January 27, 2015 14:55
-
-
Save edsilv/4427c3b055a5573a96ca to your computer and use it in GitHub Desktop.
Wellcome Player Wordpress Shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Add Shortcode: [player bnumber="b12345678" assetseq="0" asset="0" zoom="(get from address)"] | |
| function player_shortcode( $atts ) { | |
| $exatts = shortcode_atts( array ( | |
| 'bnumber' => 'b18035978', | |
| 'assetseq' => '0', | |
| 'asset' => '0', | |
| 'zoom' => '' | |
| ), $atts); | |
| //return '<h1>' . $exatts['bnumber'] . '</h1>'; | |
| return '<div class="wellcomePlayer" data-uri="http://wellcomelibrary.org/package/' . $exatts['bnumber'] . '" data-assetsequenceindex="' . $exatts['assetseq'] . '" data-assetindex="' . $exatts['asset'] . '" data-zoom="' . $exatts['zoom'] . '" data-config="/service/playerconfig" style="width: 100%; height: 420px; background-color: #000;"></div><script type="text/javascript" id="embedWellcomePlayer" src="http://wellcomelibrary.org/spas/player/build/wellcomeplayer/js/embed.js"></script>'; | |
| } | |
| add_shortcode( 'player', 'player_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment