Jace
Jace

Reputation: 3072

Getting a Wordpress widget instance from plugin

I'm currently working on the admin section of a Wordpress plugin and I need to access the instances of all of the active widgets (set in the widgets section). I've googled and googled, but I can't seem to find a way to do this.

Namely, my goal is to access the "title" text field of the widgets (if they have one). But I believe I need the widget instance to do so.

Any ideas on how I can accomplish this?

Upvotes: 0

Views: 3582

Answers (1)

Oleg Butuzov
Oleg Butuzov

Reputation: 5395

get_option('widget_text'); // as example... 

see all widget_* values in options table

$wpdb->get_results("SELECT * FROM {$wpdb->options} WHERE option_name LIKE 'widget_%')

Upvotes: 1

Related Questions