Skip to content

Commit

Permalink
Adds shortcode_ui_preview filter
Browse files Browse the repository at this point in the history
Added `shortcode_ui_preview` filter to give the option to modify the preview in the WYSIWYG.
  • Loading branch information
joseadrian committed Aug 29, 2017
1 parent e49302b commit f2e312c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inc/class-shortcode-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@ private function render_shortcode_for_preview( $shortcode, $post_id = null ) {
setup_postdata( $post );
// @codingStandardsIgnoreEnd
}

// Get the Shortcode tag and set the response if any
preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $shortcode, $matches );
if( isset($matches[1][0]) && $response = apply_filters( 'shortcode_ui_preview', false, $matches[1][0], $shortcode, $this->get_shortcode( $matches[1][0] ) ) ) {
return $response;
}

ob_start();
/**
Expand Down

0 comments on commit f2e312c

Please sign in to comment.