uiHelper(); $attachment_id = intval($_GET['attachment_id']); $attachment = get_post($attachment_id); $replacer = new Replacer($attachment_id); $file = $replacer->getSourceFile(); $uiHelper->setPreviewSizes(); $uiHelper->setSourceSizes($attachment_id); $base_image = $uiHelper->getPreviewImage($attachment_id, $file ); $replace_image = $uiHelper->getPreviewImage(-1, $file, array('remove_bg_ui' => true) ); $formurl = $uiHelper->getFormUrl($attachment_id, 'do_background_replace'); $formurl = wp_nonce_url( $formurl, "do_background_replace" ); $linebreak = '%0D%0A'; $linebreak_double = $linebreak . $linebreak; $email_subject = __('Bad remove of background report', 'enable-media-replace'); $email_body = sprintf(__('Hello! %s This is a report of a background removal that did not go well %s Url: {url} %s Settings : {settings} %s Thank you! %s', 'enable-media-replace'), $linebreak_double, $linebreak_double, $linebreak, $linebreak_double, $linebreak_double); $replace_url = add_query_arg(array( 'page' => 'enable-media-replace/enable-media-replace.php', 'action' => 'media_replace', 'attachment_id' => $attachment_id, ), admin_url("upload.php")); $defaults = array( 'bg_type' => 'transparent', 'bg_color' => '#ffffff', 'bg_transparency' => 100, ); $settings = get_option('enable_media_replace', $defaults); $settings = array_merge($defaults, $settings); // might miss some ?>