WORDPRESS FRONTEND FORM GÖNDERMEK

FORM GİRİŞİ

<form method="POST" action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" enctype="multipart/form-data">

ACTION HOOK

<input type="hidden" name="action" value="ACTION_NAME">

ADMIN POST ACTION HOOK

add_action( 'admin_post_ACTION_NAME', 'HANDLER_FUNCTION' );

NONCE FIELD

<?php wp_nonce_field( 'NONCE_MATCH', 'NONCE_NAME' ); ?>

NONCE KONTROL

if('POST' === $_SERVER['REQUEST_METHOD'] and isset( $_POST['NONCE_NAME'] ) and wp_verify_nonce( $_POST['NONCE_NAME'], 'NONCE_MATCH' ) ) {
		

One comment

Bir Yorum Yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir