X

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="http://wordpress.org/search/do-search.php" 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" />
    </form>';
}
add_filter( 'in_admin_header', 'wp_codex_search_form', 11 );

Comments  Leave a Reply

  1. Tweets that mention Wordpress Add codex search to dashboard – wpsnipp.com Wordpress code snippets for your blog -- Topsy.com January 21, 2011 at 2:48 pm

    […] This post was mentioned on Twitter by Michael Davis, WPSNIPP. WPSNIPP said: #wordpress Add codex search to dashboard http://bit.ly/eQNP18 #blog please RT 🙂 […]

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!