admin管理员组文章数量:1024668
I would like to add spacebar %20 or + on the redirect URL in the search, how can I do that with the add_query_arg?
function bulk_search() {
$redirect_to = add_query_arg( array( 's' => $_POST['s'] ), $_POST['_wp_http_referer']);
wp_redirect( $redirect_to );
exit();
}
With the function above, if in the search box I keyed in "Hello World" it would return the search with &s=helloworld on the URL instead of &s=hello+world
Thank you in advance.
I would like to add spacebar %20 or + on the redirect URL in the search, how can I do that with the add_query_arg?
function bulk_search() {
$redirect_to = add_query_arg( array( 's' => $_POST['s'] ), $_POST['_wp_http_referer']);
wp_redirect( $redirect_to );
exit();
}
With the function above, if in the search box I keyed in "Hello World" it would return the search with &s=helloworld on the URL instead of &s=hello+world
Thank you in advance.
Share Improve this question asked Apr 9, 2019 at 3:04 Calvin SengCalvin Seng 32 bronze badges1 Answer
Reset to default 0function bulk_search() {
$redirect_to = add_query_arg( array( 's' => urlencode($_POST['s']) ), $_POST['_wp_http_referer']);
wp_redirect( $redirect_to );
exit();
}
Realised by adding urlencode() function would do.
I would like to add spacebar %20 or + on the redirect URL in the search, how can I do that with the add_query_arg?
function bulk_search() {
$redirect_to = add_query_arg( array( 's' => $_POST['s'] ), $_POST['_wp_http_referer']);
wp_redirect( $redirect_to );
exit();
}
With the function above, if in the search box I keyed in "Hello World" it would return the search with &s=helloworld on the URL instead of &s=hello+world
Thank you in advance.
I would like to add spacebar %20 or + on the redirect URL in the search, how can I do that with the add_query_arg?
function bulk_search() {
$redirect_to = add_query_arg( array( 's' => $_POST['s'] ), $_POST['_wp_http_referer']);
wp_redirect( $redirect_to );
exit();
}
With the function above, if in the search box I keyed in "Hello World" it would return the search with &s=helloworld on the URL instead of &s=hello+world
Thank you in advance.
Share Improve this question asked Apr 9, 2019 at 3:04 Calvin SengCalvin Seng 32 bronze badges1 Answer
Reset to default 0function bulk_search() {
$redirect_to = add_query_arg( array( 's' => urlencode($_POST['s']) ), $_POST['_wp_http_referer']);
wp_redirect( $redirect_to );
exit();
}
Realised by adding urlencode() function would do.
本文标签: pluginsAdd spacebar in WP List Table Search
版权声明:本文标题:plugins - Add spacebar in WP List Table Search 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745612478a2159087.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论