Difference between widget form code variables

$this is the widget object, an instance of the relevant widget class. It includes things like the widget ID and class identifiers which are required for the method that generate the input id and name attribute in the snippet $instance is the array which includes the widget setting. The settings ae not stored as part … Read more

Reorder dashboard widgets

Clearing things up First, there’s a slight misunderstanding. wp_dashboard_setup is an action and not a filter. If it would be a filter, it would have one or multiple arguments and would need to return the first one. How-To #1 For an example of this action, see the following mu-plugin I use: <?php /** * Plugin … Read more

How to update widget from widget() function?

Huh. It had never actually occurred to me to use widget instance as cache. I hadn’t ever seen such implementation either. This is quite an original idea, and as such it is hard to accurately point out benefits and issues with implementation. For starters update() doesn’t actually save anything, it just used as check for … Read more

How can I delete all inactive widgets?

You should do it with after_setup_theme action: function remove_inactive_widgets() { $sidebars_widgets = get_option( ‘sidebars_widgets’ ); $sidebars_widgets[‘wp_inactive_widgets’] = array(); update_option( ‘sidebars_widgets’, $sidebars_widgets ); } add_action( ‘after_setup_theme’, ‘remove_inactive_widgets’ );

What is the best way to include a widget in a Page?

This plugin might be the easy way. http://wordpress.org/extend/plugins/add-widgets-to-page/ But for a scratch method… Look into Theme Twenty-Ten’s functions.php file and find where the dynamic sidebars are registered. It looks like this: <?php function twentyten_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( ‘name’ => __( ‘Primary Widget Area’, ‘twentyten’ ), … Read more

Copy widget settings from one blog to another

I don’t think there is anything specifically for this. You might want to look at the plugin code to find calls to get_option() and see what keys they are using, then browse the DB table wp_options with phpMyAdmin (or whatever) and grab the associated values. Without specific support from the plugin this can be iffy … Read more

Bookshelf plugin and/or widget [closed]

There are quite a few plugins tagged books in official repository. A lot of them seems to pull covers from services like Amazon, which may or may not fit your needs. If you want to simply display some self-hosted images with links and basic categorizing/sorting, personally I like to use Links for such.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)