atts = shortcode_atts( array(
'id' => '',
), $atts, 'pwp_splitview' );
// First, check if there is an id.
if ( isset( $this->atts['id'] ) && ! empty( $this->atts['id'] ) ) {
$this->prepare();
return $this->output();
}
else
return '
' . wp_kses_data( $post->post_title ) . '
' . wpautop( wptexturize( $post->post_content ) ) . '
';
return $_html;
}
/**
* Get a youtube video
*
* @param string $video video id.
* @return string html for video
*/
protected function youtube( $video = '' ) {
if ( empty( $video ) || ! is_string( $video ) ) {
return '';
}
$_html = '' . premise_output_video( $video ) . '
';
return $_html;
}
/**
* Get an image
*
* @param string $url url for image.
* @return string div with image as background
*/
protected function image( $url = '' ) {
if ( empty( $url ) || ! is_string( $url ) ) {
return '';
}
$_html = '
' . wpautop( wptexturize( $content ) ) . '
';
}
else {
$_html = 'No content was inserted';
}
return $_html;
}
/**
* Output the shortcode
*
* @return string the shortcode's html
*/
public function output() {
if ( '' !== $this->html ) {
return $this->html;
}
return 'Looks like there was an issue building the Split View.
';
}
}