'; } $attr = shortcode_atts( array( 'id' => '', 'w' => '', 'h' => '', 'fb' => '', 'mw' => '', 'mh' => '', 'sc' => '', 'pro' => '', 'style' => '', ), $arguments ); // check that the Slideshare ID contains letters, numbers and query strings. $pattern = '/[^-_a-zA-Z0-9?=&]/'; if ( empty( $attr['id'] ) || preg_match( $pattern, $attr['id'] ) ) { return ''; } // check the width/height. $w = (int) $attr['w']; // If no width was specified (or uses the wrong format), and if we have a $content_width, use that. if ( empty( $w ) && ! empty( $content_width ) ) { $w = (int) $content_width; } elseif ( $w < 300 || $w > 1600 ) { // If width was specified, but is too small/large, set default value. $w = 425; } else { $w = (int) $w; } $h = ceil( $w * 348 / 425 ); // Note: user-supplied height is ignored. if ( ! empty( $attr['pro'] ) ) { $source = 'https://www.slideshare.net/slidesharepro/' . $attr['id']; } else { $source = 'https://www.slideshare.net/slideshow/embed_code/' . $attr['id']; } if ( isset( $attr['rel'] ) ) { $source = add_query_arg( 'rel', (int) $attr['rel'], $source ); } if ( ! empty( $attr['startSlide'] ) ) { $source = add_query_arg( 'startSlide', (int) $attr['startSlide'], $source ); } $player = sprintf( "