// ==== Shortcode Upload Print On Demand ==== function matoos_upload_form() { ob_start(); ?>

Layanan Print On Demand

$name) { $fileTmp = $_FILES['matoos_files']['tmp_name'][$key]; $fileSize = $_FILES['matoos_files']['size'][$key]; $fileName = time() . "_" . sanitize_file_name($name); $targetFile = $targetDir . $fileName; if ($fileSize > $maxFileSize) { $errors[] = "$name (terlalu besar, max 10MB)"; continue; } if (move_uploaded_file($fileTmp, $targetFile)) { $fileUrl = $uploadDir['baseurl'] . "/matoos_uploads/" . $fileName; $uploadedFiles[] = $fileUrl; } else { $errors[] = "$name (gagal upload)"; } } } if ($uploadedFiles) { // Kirim email admin $to = "akhmadharizoos@gmail.com"; $subject = "Pelanggan upload file (Print On Demand)"; $message = "Email pelanggan: $customer_email\nCatatan: $customer_note\n\nFile:\n" . implode("\n", $uploadedFiles); $headers = "From: support@matoos.net"; wp_mail($to, $subject, $message, $headers); echo "

✅ Upload berhasil!

"; echo "

Email: $customer_email

"; if ($customer_note) echo "

Catatan: $customer_note

"; echo ""; echo ""; echo "
"; } if ($errors) { echo "

❌ Beberapa file gagal:

"; } } return ob_get_clean(); } add_shortcode('matoos_upload', 'matoos_upload_form'); function allow_iframe_in_posts($allowedposttags){ $allowedposttags['iframe'] = array( 'src' => true, 'width' => true, 'height' => true, 'frameborder' => true, 'allowfullscreen' => true, 'style' => true, 'title' => true ); return $allowedposttags; } add_filter('wp_kses_allowed_html','allow_iframe_in_posts');