Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are WordPress default widget files or functions located?

Tags:

I'm trying to slightly modify the default WordPress tag cloud widget. I don't want to create my own widget because I literally want to adjust one small thing. I've looked through my WordPress installation but can't find the PHP file that contains the basic widgets.

Even though I assume that they are defined in each theme, I still looked in the core directories but came up empty handed.

So if any of you happen to have already figured this out, please make my life easier and let me know where I can find the default widgets...most importantly the tag cloud widget.

Thanks

like image 916
kevtrout Avatar asked Feb 19 '10 01:02

kevtrout


People also ask

Where are WordPress widgets stored?

You can find your widget area by going to Appearance » Widgets in your WordPress admin dashboard. Here you'll see a list of your available widget areas. In the example below using the Astra theme, there are multiple areas you can add widgets, including the sidebar, header, and footer.

What is the function of widgets in WordPress?

What Are WordPress Widgets? A WordPress widget is a modular element that enables you to add a specific feature to your website. Widgets can be added to different areas of a website, such as a website's sidebars or footer areas, and they're an inherent part of WordPress' design and layout customizations.

Where is the widget code in WordPress?

Using WordPress Custom WidgetGo to the Appearance menu, and select Widgets. You should see a widget named Hostinger Sample Widget in the Available Widgets list. Next, drag the widget and drop it in the Sidebar section on the right side of the page. Save your changes and visit your website.


Video Answer


1 Answers

Those are located in the default widget class:

/wp-includes/default-widgets.php 

For more detail: http://phpdoc.wordpress.org/trunk/WordPress/Widgets/WP_Widget_Tag_Cloud.html

The widget invokes a function deeper though that generates the actual output. You'll want to take a look at the wp_tag_cloud and wp_generate_tag_cloud functions in:

/wp-includes/category-template.php 
like image 62
Dave Konopka Avatar answered Oct 14 '22 12:10

Dave Konopka