Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e0f92bd
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = '&theme='.$args['theme']; | ||
} | ||
|
||
if (isset($args['view'])) { // list* | cover art => &view=coverart | ||
$view = '&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; | ||
|
||
} |