| @@ -7,8 +7,12 @@ | ||
| 7 | 7 | * |
| 8 | 8 | * @package automattic/jetpack |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit( 0 ); | |
| 13 | +} | |
| 14 | + | |
| 11 | 15 | if ( ! shortcode_exists( 'spotify' ) ) { |
| 12 | 16 | add_shortcode( 'spotify', 'jetpack_spotify_shortcode' ); |
| 13 | 17 | } |
| 14 | 18 | |
| @@ -22,8 +26,11 @@ | ||
| 22 | 26 | * |
| 23 | 27 | * @return string |
| 24 | 28 | */ |
| 25 | 29 | function jetpack_spotify_shortcode( $atts = array(), $content = '' ) { |
| 30 | + if ( ! is_array( $atts ) ) { | |
| 31 | + $atts = array(); | |
| 32 | + } | |
| 26 | 33 | |
| 27 | 34 | if ( ! empty( $content ) ) { |
| 28 | 35 | $id = $content; |
| 29 | 36 | } elseif ( ! empty( $atts['id'] ) ) { |