WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Duplicate Widget

Version: 1.0.2 A widget that can act as a duplicate of another widget (for synchronized use in another sidebar)

Filters

The plugin exposes four actions for hooking. Typically, customizations utilizing these hooks would be put into your active theme's functions.php file, or used by another plugin.

c2c_before_duplicate_widget (action)

The 'c2c_before_duplicate_widget' hook allows you to output text, or perform some sort of action, just before the output of the duplicate widget.

Arguments:

  • $instance (array) : The settings for the widget instance (namely: title and widget_to_duplicate)
  • $args (array) : The configuration for the widget and sidebar

Example:

// Output an opening <div> before duplicate widget content
add_action( 'c2c_before_duplicate_widget', 'my_c2c_before_duplicate_widget', 10, 2 );
function my_c2c_before_duplicate_widget( $instance, $args ) {
    echo '<div class="a_duplicate_widget">;
}

c2c_after_duplicate_widget (action)

The 'c2c_after_duplicate_widget' hook allows you to output text, or perform some sort of action, just after the output of the duplicate widget.

Arguments:

  • $instance (array) : The settings for the widget instance (namely: title and widget_to_duplicate)
  • $args (array) : The configuration for the widget and sidebar

Example:

// Output an closing </div> after duplicate widget content
add_action( 'c2c_after_duplicate_widget', 'my_c2c_after_duplicate_widget', 10, 2 );
function my_c2c_after_duplicate_widget( $instance, $args ) {
    echo '</div>;
}

c2c_before_duplicate_widget_form (action)

The 'c2c_before_duplicate_widget_form' hook allows you to output text, or perform some sort of action, just before the output of the duplicate widget's configuration form (in the WP admin).

Arguments:

  • $instance (array) : The settings for the widget instance (namely: title and widget_to_duplicate)

Example:

// Display a message just before the duplicate widget settings form
add_action( 'c2c_before_duplicate_widget_form', 'my_c2c_before_duplicate_widget_form' );
function my_c2c_before_duplicate_widget_form( $instance ) {
    echo '<p>Note: this is a note above the widget settings form.</p>';
}

c2c_after_duplicate_widget_form (action)

The 'c2c_after_duplicate_widget_form' hook allows you to output text, or perform some sort of action, just after the output of the duplicate widget's configuration form (in the WP admin).

Arguments:

  • $instance (array) : The settings for the widget instance (namely: title and widget_to_duplicate)

Example:

// Display a message just after the duplicate widget settings form
add_action( 'c2c_after_duplicate_widget_form', 'my_c2c_after_duplicate_widget_form' );
function my_c2c_after_duplicate_widget_form( $instance ) {
    echo '<p>Note: this is a note below the widget settings form.</p>';
}

Requires: 3.1 or higher
Compatible up to: 3.4.2
Last Updated: 2012-6-12
Downloads: 16,739

Ratings

4 stars
4.6 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
1 person says it's broken.

100,2,2
100,1,1
100,3,3
50,2,1
0,2,0
50,2,1
50,2,1
50,2,1
0,1,0
50,2,1