1
저는 개발중인 Wordpress 플러그 인을 처음 사용합니다. 검색 양식을 디자인했지만 제출 된 양식 데이터를 어디서 처리하고 인쇄해야하는지 잘 모릅니다. 에 의해 (형태 = ""Wordpress 플러그인 폼 문제
function widget($args, $instance) {
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$message = apply_filters('widget_content', $instance['content']);
echo $before_widget;
//if ($title)
// echo $before_title . $title . $after_title;
echo '<div class="shk_location_form_holder">
<span class="shk_loc_title">'.$title.'
<form mthod="post">
<input type="text" name="shk_inp_search_locations" id="shk_inp_search_locations" /><br>
<div style="height:5px"></div>
<input type="submit" Value="Search Locations" />
</form></div>';
echo $after_widget;
if(isset($_REQUEST['shk_inp_search_locations'])){
add_filter('the_content','handle_content');
}
}
양식에 _action_ 매개 변수가 없습니다. 다른 .php 파일로 보내거나, 액션을 비워두고 같은 페이지/파일/위젯에 $ _POST 데이터를 처리하거나 [AJAX] (http://www.askaboutphp.com/213/php-and- jquery-submit-a-form-without-refresh-the-page.html)을 사용하여 데이터를 처리합니다. –