Skip to content

Commit

Permalink
Only remove the form submit for forms that are rendered in the admin …
Browse files Browse the repository at this point in the history
…editor
  • Loading branch information
polevaultweb committed Nov 18, 2023
1 parent 3797bd6 commit ad9016a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ public function generate_shortcode_string() {
* Written in PHP and used to generate the final HTML.
*/
protected function render() {
$shortcode = do_shortcode( shortcode_unautop( $this->generate_shortcode_string() ) );
$output = $shortcode;
$output = do_shortcode( shortcode_unautop( $this->generate_shortcode_string() ) );
if ( is_admin() ) {
$output = preg_replace( "/<form action=([\"'])(.*?)\"/", '<form action="javascript:void(0);"', $output );
}
echo $output; // phpcs:ignore
}

Expand Down

0 comments on commit ad9016a

Please sign in to comment.