First Core Contribution

This is minor in the overall scheme of WordPress development, but I have had my first patch/contribution committed to the WordPress core! It’s the addition of a function called get_search_link that will allow template authors/developers to generate a link to either the current search or to a new search if a parameter is passed to it.

The ticket history & patches can be viewed in the the following trac ticket: #10552


If you are on a search page (?s=query or /search/query/) then you do not need to pass a parameter and the function will take the current query string. you can use it like so:

get_search_link( );

If you need to link or start a new search you can pass it a parameter:

get_search_link('new search');


sirzooro opened a ticket 7 months ago requesting a new get_search_link function and proposed some code. This was during the time of the 2.9 feature freeze so the ticket was punted to the 3.0 release.

I wanted to help out during the feature freeze but didn’t have a lot of time in the last week to contribute so I searched for some tickets that needed testing or needed a patch that I would be able to handle. I found the get_search_link ticket and thought it was a good idea (it also goes with some of the new search functionality in 3.0  -more on this later) to get it added to core. We already had get_search_feed_link and a comments search feed function after all.

The code needed a little updating to be used in 3.0 so I submitted a patch and after some back and forth from dd32 the patch was fixed up and submitted a second time.

Late last night the change was finally committed to core.

Closing Comments

It’s exciting to see (even with some minor bit of code) the collaboration that happens within WordPress and open source software. Anyone can jump in there and work with other developers to get a feature added.

Although the feature freeze for 3.0 hits tomorrow it  has really added to my interesting in helping with the WordPress moment and I hope to contribute big fixes and help out on the support/documentation side of things in the next few weeks.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s