input_shortcode = sanitize_text_field($_REQUEST['shortcode']); $this->input_shortcode = base64_decode($this->input_shortcode); // The in-flight shortcode is passed from screen to screen using the JS function `btoa`, in wizard.js, which encodes it $this->input_shortcode = json_decode($this->input_shortcode); } $this->editor_shortcode = [ 'provider' => '', ]; if (!empty($this->input_shortcode) && !empty($this->input_shortcode->shortcode)) { $this->editor_shortcode_text = esc_attr($this->input_shortcode->content); $shortcode = $this->input_shortcode->shortcode; $attrs = $shortcode->attrs; $attrs = $attrs->named; if ((!empty($attrs->type) && in_array($attrs->type, ['wp', 'flickr', 'smugmug', 'zenfolio', 'deviantart'], true)) || (empty($attrs->type) && !empty($attrs->style)) && in_array($attrs->style, ['square', 'circle', 'random', 'masonry', 'masonry-horizontal', 'mosaic', 'strip-above', 'strip-below', 'strip-right', 'no-strip'], true)) { $this->editor_shortcode['provider'] = !empty($attrs->type) ? $attrs->type : 'wp'; } } } } public function render() { if (wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['nonce'] ?? '')), 'photonic-wizard-' . get_current_user_id())) { ?>