我清理了您的代码,并放置了安装它所需的所有头信息。你的插件工作正常,我测试过了!
/*
Author: whoever
Plugin Name: Some Name
Plugin URI:
Text Domain: some-domain
Version: 1.0
*/
function DynamiteSearch($form)
{
$form = "<form method = \'get\' id = \'searchform\' action = \' ".site_url()." \' >";
$form .= "<div><label class = \'hidden\' for=\'s\'>". __("Search for: ") . "</label>";
$form .= "<input type = \'text\' value=\' ". attribute_escape(apply_filters(\'the_search_query\', get_search_query())) ." \' name=\'s\' id=\'s\' />";
$form .= "<input type = \'submit\' id=\'searchsubmit\' value=\' ".attribute_escape(__(\'Look for it\'))." \' />";
$form .= "</div>";
$form .= "</form>";
return $form;
}
add_filter(\'get_search_form\', \'DynamiteSearch\');
尝试更改“提交”按钮文本以查看其是否有效。如果对你有用,请告诉我。
谢谢Rutwick