Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfieZero committed Apr 11, 2012
0 parents commit e0f92bd
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
47 changes: 47 additions & 0 deletions readme.txt
@@ -0,0 +1,47 @@
=== Spotify Play Button ===

Contributors: wolfiezero
Donate link: http://wolfiezero.com/donate/
Tags: spotify, play button, music
Requires at least: 3.0
Tested up to: 3.3.1
Stable tag: 1.0

Easily add the Spotify Play Button via a short code



== Description ==

Creating polls is now easy! With this plugin you can easily create a poll, add it to a page or post and users can instantly vote. Allows the creation of unlimited polls with up to 10 answers each. Theming is also possible by altering the files in `view/client` (though hope to improve theming greatly in future updates).



== Installation ==

1. Download and unzip
2. Upload to your `wp-content/plugins` folder
3. Activate from the dashboard
4. Add or edit a post or page
5. Add the short code [spotify-play src=""] with the "Spotify URI" in between the `src` quotes



== Frequently Asked Questions ==

= I have an issue with Spotfy Play Button plugin, where do I go to report the issue? =

There are a number of places, the most popular being on the [WordPress.org forum](http://wordpress.org/tags/spotify-play-buttonforum_id=10), you can also report an issue on [Github page](https://github.com/WolfieZero/wp-spotify-play-button/issues/) or [contact myself directly](http://wolfiezero.com/contact/).


= Is there a bleeding edge version of Spotfy Play Button? =

Yes there is! It's on [Github](https://github.com/WolfieZero/wp-spotify-play-button/).



== Changelog ==

= 1.0 =

* Initial release
45 changes: 45 additions & 0 deletions spotify-play-button.php
@@ -0,0 +1,45 @@
<?php
/*
Plugin Name: Spotify Play Button
Version: 1.0
Plugin URI: http://wolfiezero.com/wordpress/spotify-play-button/
Description: Adds the Spotify Play Button to your post or page content
Author: WolfieZero
Author URI: http://wolfiezero.com/
*/

add_shortcode('spotify-play', 'showSpotifyPlayButton');

function showSpotifyPlayButton($args) {

// https://developer.spotify.com/technologies/spotify-play-button/documentation/

$src = '';
$size = '';
$theme = '';
$view = '';
$h = '380px';
$w = '300px';


if (isset($args['size']) && $args['size'] == 'compact') {
$h = '80px';
}

if (isset($args['theme'])) { // dark* | light => &theme=white
$theme = '&amp;theme='.$args['theme'];
}

if (isset($args['view'])) { // list* | cover art => &view=coverart
$view = '&amp;view='.$args['view'];
}

if (isset($args['src'])) $src = $args['src']; // Spotify URI
if (isset($args['width'])) $w = $args['width'];
if (isset($args['height'])) $h = $args['height'];

$html = '<iframe src="https://embed.spotify.com/?uri='.$src.$theme.$view.'" style="width:'.$w.'; height:'.$h.';" frameborder="0" allowTransparency="true"></iframe>';

return $html;

}

0 comments on commit e0f92bd

Please sign in to comment.