Add codex search to dashboard

Adding this PHP code snippet to the functions.php of your wordpress theme will add a search field to your dashboard for searching the wordpress codex.



function wp_codex_search_form() {
echo '<form target="_blank" method="get" action="" class="alignright" style="margin: 11px 5px 0;">
<input type="text" onblur="this.value=(this.value=='') ? 'Search the Codex' : this.value;" onfocus="this.value=(this.value=='Search the Codex') ? '' : this.value;" maxlength="150" value="Search the Codex" name="search" class="text"> <input type="submit" value="Go" class="button" />
add_filter( 'in_admin_header', 'wp_codex_search_form', 11 );

Leave a comment