4

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

4

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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