Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i would like to find the source code of the widgets, would you know where to find them? I found the class WP_Widget, but i would like to find, for example, the widget with the last articles.

Thanks

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

The default widgets are defined in wp-includes/default-widgets.php.

To find specific code search the Codex or use queryposts.com. The best tool is your IDE (integrated development environment). All IDEs offer a full text search in a set of files.

Here a screen shot from Eclipse PDT

enter image description here

As you can see it is really flexible – and it's fast too. See also this question for a basic guide on how to work with WordPress in an IDE.

share|improve this answer
1  
another link to find the source code of WordPress functions: phpxref.ftwr.co.uk/wordpress/nav.html?_functions/index.html –  Michael May 18 '12 at 9:33
    
@Michael Thanks ! –  Paul May 18 '12 at 10:15
    
@toscho : Thanks ! –  Paul May 18 '12 at 10:15
add comment

Widgets can come from any number of sources: plugins, themes, or the core itself. As such, finding the code for a specific widget could prove troublesome if you do not know it's origin. You could grep for it using bits you know, or grep for all widgets using extends WP_Widget. If you know where it comes from (core, plugin, etc) it's a simple matter of thumbing (or greping, I suppose) through code.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.