0
내 Wordpress 사이트에서 양식을 제출 한 후 example.com/user와 같은 페이지로 리디렉션하고 싶습니다.양식 제출을 다른 페이지로 리디렉션 문제
<!-- Submission Form -->
<form method="post" action="" id="wcv-product-edit" class="wcv-form wcv-formvalidator">
양식의 말 :
<?php WCVendors_Pro_Product_Form::form_data($object_id, $post_status); ?>
<?php WCVendors_Pro_Product_Form::save_button($title); ?>
I 양식의 내부에 배치하려고 :
header('Location: http://www.example.com/user');
여기
:method:POST
:path:/dash/product/edit/
는 형태의 시작입니다
하지만 양식이있는 전체 페이지가 리디렉션됩니다. example.com/user에 양식 제출없이 위치합니다. 양식은 /dash/product/edit/
경로에 있습니다.
public function process_submit() {
if (! isset($_POST[ '_wcv-save_product' ]) || !wp_verify_nonce($_POST[ '_wcv-save_product' ], 'wcv-save_product') || !is_user_logged_in()) {
return;
}
$can_submit_live = WC_Vendors::$pv_options->get_option('can_submit_live_products');
$current_post_status = isset($_POST[ 'post_status' ]) ? $_POST[ 'post_status' ] : '';
$can_edit_approved = WC_Vendors::$pv_options->get_option('can_edit_approved_products');
$trusted_vendor = (get_user_meta(get_current_user_id(), '_wcv_trusted_vendor', true) == 'yes') ? true: false;
$untrusted_vendor = (get_user_meta(get_current_user_id(), '_wcv_untrusted_vendor', true) == 'yes') ? true: false;
if ($trusted_vendor) $can_submit_live = true;
if ($untrusted_vendor) $can_submit_live = false;
$text = array('notice' => '', 'type' => 'success');
가 어떻게 그것을 후에 만 성공적으로 양식을 제출 example.com/user
로 리디렉션 할 수 있습니다 : 나는 (양식 있음)이 경로를 요청할 때 그래서 그냥
폼 컨트롤러를 example.com/user 리디렉션?
내가 플러그인을 사용하지만 플러그인의 일부 형태로 사용할 수 있습니다 양식을 작성하고 있기 때문에/ –
및 너 자신 검증. 유효성 검사 실패 또는 성공 결과를 얻습니까? 당신이한다면'header ('Location : http://www.example.com/user');를'if 문 '으로 바인드 할 수 있습니다. 리디렉션은 아무 이유없이 발생합니다. 독립 실행 형 함수이고 아무 것도 쿼리와 같은 기본 흐름을 방해하지 않습니다. –
안녕하세요, 내 질문을 편집하고 제출 버튼에 if 문을 사용하여 양식 컨트롤러를 추가했습니다. 그것을 확인하시기 바랍니다. –