diff --git a/includes/Fields/Form_Field_Post_Content.php b/includes/Fields/Form_Field_Post_Content.php index 06f2d8de3..0e7928ecc 100755 --- a/includes/Fields/Form_Field_Post_Content.php +++ b/includes/Fields/Form_Field_Post_Content.php @@ -11,6 +11,27 @@ public function __construct() { $this->name = __( 'Post Content', 'wp-user-frontend' ); $this->input_type = 'post_content'; $this->icon = 'text-width'; + + // check if block theme is active + if ( function_exists( 'wp_is_block_theme' ) && wp_is_block_theme() ) { + add_filter( 'format_for_editor', [ $this, 'format_for_editor' ], 10, 2 ); + } + } + + /** + * Format the content for editor. Need to do this for block theme support + * + * @param string $content + * @param string $default_editor + * + * @return string + */ + public function format_for_editor( $content, $default_editor ) { + if ( 'tinymce' !== $default_editor ) { + return $content; + } + + return htmlspecialchars_decode( $content, ENT_NOQUOTES ); } /** diff --git a/includes/Frontend/Frontend_Form.php b/includes/Frontend/Frontend_Form.php index 92e59a8ad..5524cde56 100755 --- a/includes/Frontend/Frontend_Form.php +++ b/includes/Frontend/Frontend_Form.php @@ -33,8 +33,8 @@ public function __construct() { * * @param array $atts * - * @return - **/ + * @return false|string + */ public function edit_post_shortcode( $atts ) { add_filter( 'wpuf_form_fields', [ $this, 'add_field_settings' ] ); // @codingStandardsIgnoreStart @@ -52,7 +52,13 @@ public function edit_post_shortcode( $atts ) { wp_login_form(); - return; + return ''; + } + + $nonce = isset( $_GET['_wpnonce'] ) ? sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ) : ''; + + if ( ! wp_verify_nonce( $nonce, 'wpuf_edit' ) ) { + return '