plugin_name = $plugin_name; $this->streetview = new WPVR_StreetView(); $this->video = new WPVR_Video(); $this->scene = new WPVR_Scene(); } /** * Shortcode output for the plugin * * @param array $atts * * @return array * @since 8.0.0 */ public function wpvr_shortcode($atts) { extract( shortcode_atts( array( 'id' => 0, 'width' => null, 'height' => null, 'mobile_height' => null, 'radius' => null ), $atts ) ); $id = esc_attr($id); $width = esc_attr($width); $height = esc_attr($height); $mobile_height = esc_attr($mobile_height); $radius = esc_attr($radius); if (!$id) { $obj = get_page_by_path($slug, OBJECT, $this->post_type); if ($obj) { $id = $obj->ID; } else { return __('Invalid Wpvr slug attribute', $this->plugin_name); } } if (empty($mobile_height)) { $mobile_height = "300px"; } $get_post = get_post_status($id); if ( $get_post !== 'publish' ) { return esc_html__('Oops! It seems like this post isn\'t published yet. Stay tuned for updates!', 'wpvr') ; } if( post_password_required( $id ) ){ return get_the_password_form(); } $postdata = get_post_meta($id, 'panodata', true); $panoid = 'pano'.$id; if (isset($postdata['streetviewdata'])){ $html = $this->streetview->render_streetview_shortcode($postdata, $width, $height); return $html; } if (isset($postdata['vidid'])) { $html = $this->video->render_video_shortcode($postdata, $id, $width, $height, $radius); return $html; } $html = $this->scene->render_scene_shortcode($postdata, $panoid, $id, $radius, $width, $height, $mobile_height); return $html; } }