| @@ -5,8 +5,12 @@ | ||
| 5 | 5 | * |
| 6 | 6 | * @package automattic/jetpack |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit( 0 ); | |
| 11 | +} | |
| 12 | + | |
| 9 | 13 | /** |
| 10 | 14 | * Scrub URL paramaters for VR viewer |
| 11 | 15 | * |
| 12 | 16 | * @param array $params { |
| @@ -83,9 +87,9 @@ | ||
| 83 | 87 | $iframe = add_query_arg( $url_params, 'https://vr.me.sh/view/' ); |
| 84 | 88 | |
| 85 | 89 | // set some defaults. |
| 86 | 90 | $maxwidth = ( is_numeric( $content_width ) && $content_width > 0 ) ? $content_width : 720; |
| 87 | - $view = ( isset( $url_params['view'] ) ) ? $url_params['view'] : 'cinema'; | |
| 91 | + $view = $url_params['view'] ?? 'cinema'; | |
| 88 | 92 | |
| 89 | 93 | // If the shortcode is displayed in a WPCOM notification, display a simple link only. |
| 90 | 94 | if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { |
| 91 | 95 | require_once WP_CONTENT_DIR . '/lib/display-context.php'; |
| @@ -121,9 +125,9 @@ | ||
| 121 | 125 | * </div> |
| 122 | 126 | * |
| 123 | 127 | * @param array $atts Shortcode attributes. |
| 124 | 128 | * |
| 125 | - * @return html - complete vr viewer html | |
| 129 | + * @return string complete vr viewer html | |
| 126 | 130 | */ |
| 127 | 131 | function jetpack_vr_viewer_shortcode( $atts ) { |
| 128 | 132 | $params = shortcode_atts( |
| 129 | 133 | array( |