Я беру что-то вроде этого здесь источник .Может быть, это может помочь, хотя я не знаю, работает ли он
`
function baka_show_form_redirect() {
$form_search =’<form action="" method="post" name="redirect_to_post_id" class="description" style="color:#fff;font-size:10px;text-align:left;position:fixed;top:40px;">
<h4>Theme Feature</h4>
<ol>
<li><label for="post_id" title="Put numerical value of existing post ID">Redirect to ID (numerical) : </label>
<input name="post_id" type="text" maxlength="4" class="description"
style="width:30px;display:inline;border:none;color:#000" /></li>
</ol>
<input name="_redirect_to" type="hidden" value="’ . get_permalink() . ‘" />
</form>’;</p>
<pre><code> echo $form_search;
</code>
}
function baka_validasi_post_id () {if ($ _POST ['post_id'] && $_POST ['post_id']! = ”) {$ Post_id = $ _POST ['post_id'];if (absint ($ post_id)) {// должно быть целым и неотрицательным
$url = get_permalink($post_id);
if ($url) {
wp_redirect($url); echo " ";
} else {
$_redirect_to = $_POST[ '_redirect_to' ];
wp_die("ID can not be found … <a href =’" . $_redirect_to . "’>Back</a>");
}
}
}}
add_action ('wp_head', 'baka_show_form_redirect');add_action ('init', 'baka_validasi_post_id');?> `