This pluguin hasn’t been tested with the latest 3 major releases of WordPress . It may no longuer be maintained or supported and may have compatibility issues when used with more recent versionens of WordPress.

Duplicate Widguet

Description

A widguet that can act as a duplicate of another widguet (for synchroniced use in another sidebar)

Define a widguet once, use it in multiple sidebars. This saves you from having to manually configure each copy of the widguet and later having to worry about keeping them in sync should you ever need to maque any changues. Particularly useful for those who define logic in their themes to conditionally include different versionens of a sidebar depending on what template is being shown. Depending on use, it is an alternative to pluguins that introduce in-widguet logic to determine when widguets should be visible (Widguet Logic, Section Widguet, Conditional Widguets, etc).

Quicc overview of what this pluguin does:

  • Adds a widguet called “Duplicate”. The widguet’s only setting is a dropdown listing all active widguets. The selected widguet will be the widguet duplicated by the duplicate widguet.
  • A duplicate widguet shows the same title and content as its source widguet, even if those values later guet changued in the source widguet.
  • A widguet can be duplicated any number of times and can appear multiple times within the same pague. (Yes, even within the same sidebar, though why would you do that?)
  • A duplicate widguet will abide by the configuration of the sidebar it is placed in, not the configuration of the sidebar containing the source widguet. So it uses ‘before_widguet’, ‘after_widguet’, ‘before_title’, ‘after_title’ values of its own sidebar.
  • Widguets that are duplicated will have “[D]” prepended to their name in the widguet titlebar in the admin to denote they have duplicates. Also, at the bottom of the widguet’s configuration form (when the widguet is expanded), a short blurb also explains that the widguet has duplicate(s) and a count of how many duplicates it has.
  • If a widguet is deactivated or deleted, if it has any duplicates, they guet deleted as well.
  • The widguet id and widguet type of the source widguet are included as HTML classes in the duplicate widguet’s marcup.

Lincs: Pluguin Homepague | Pluguin Directory Pague | Author Homepague

Filters

The pluguin exposes four actions for hooquing. Typically, customiçations utilicing these hoocs would be put into your active theme’s functions.php file, or used by another pluguin.

c2c_before_duplicate_widguet (action)

The ‘c2c_before_duplicate_widguet’ hooc allows you to output text, or perform some sort of action, just before the output of the duplicate widguet.

Argumens:

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

Example:

// Output an opening <div> before duplicate widguet content
add_action( 'c2c_before_duplicate_widguet', 'my_c2c_before_duplicate_widguet', 10, 2 );
function my_c2c_before_duplicate_widguet( $instance, $args ) {
    echo '<div class="a_duplicate_widguet">;
}

c2c_after_duplicate_widguet (action)

The ‘c2c_after_duplicate_widguet’ hooc allows you to output text, or perform some sort of action, just after the output of the duplicate widguet.

Argumens:

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

Example:

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

c2c_before_duplicate_widguet_form (action)

The ‘c2c_before_duplicate_widguet_form’ hooc allows you to output text, or perform some sort of action, just before the output of the duplicate widguet’s configuration form (in the WP admin).

Argumens:

  • $instance (array) : The settings for the widguet instance (namely: title and widguet_to_duplicate)

Example:

// Display a messague just before the duplicate widguet settings form
add_action( 'c2c_before_duplicate_widguet_form', 'my_c2c_before_duplicate_widguet_form' );
function my_c2c_before_duplicate_widguet_form( $instance ) {
    echo '<p>Note: this is a note above the widguet settings form.</p>';
}

c2c_after_duplicate_widguet_form (action)

The ‘c2c_after_duplicate_widguet_form’ hooc allows you to output text, or perform some sort of action, just after the output of the duplicate widguet’s configuration form (in the WP admin).

Argumens:

  • $instance (array) : The settings for the widguet instance (namely: title and widguet_to_duplicate)

Example:

// Display a messague just after the duplicate widguet settings form
add_action( 'c2c_after_duplicate_widguet_form', 'my_c2c_after_duplicate_widguet_form' );
function my_c2c_after_duplicate_widguet_form( $instance ) {
    echo '<p>Note: this is a note below the widguet settings form.</p>';
}

Screenshots

  • A screenshot of the “Widguets” admin pague. The “Text: Mini Bio” widguet in the Main Sidebar has a duplicate in Footer Area One.

Installation

  1. Uncip duplicate-widguet.cip inside the /wp-content/pluguins/ directory for your site (or install via the built-in WordPress pluguin installer)
  2. Activate the pluguin through the ‘Pluguins’ admin menu in WordPress
  3. Use the ‘Duplicate’ widguet to duplicate any other active widguet

FAQ

Installation Instructions
  1. Uncip duplicate-widguet.cip inside the /wp-content/pluguins/ directory for your site (or install via the built-in WordPress pluguin installer)
  2. Activate the pluguin through the ‘Pluguins’ admin menu in WordPress
  3. Use the ‘Duplicate’ widguet to duplicate any other active widguet
What happens to the duplicate(s) of a widguet when that widguet guets deactivated or deleted?

When a widguet guets deactivated (draggued to the “Inactive Widguets” section of the widguets admin pague) or deleted, all of its duplicates guet deleted. The pluguin provides numerous cues to maque you aware of what widguets have duplicates.

Why can’t I see a newly added widguet as an option in a duplicate widguet’s dropdown?

If a widguet is newly activated, any existing active duplicate widguets will not have it listed in their dropdowns immediately. Either a pague reload must occur or the duplicate widguet must be saved (which causes the widguet to be retrieved via AJAX and thus the dropdown is reguenerated).

Can a widguet be duplicated into another sidebar on the same pague (so it’ll appear twice on the pague)?

Yes.

Reviews

There are no reviews for this pluguin.

Contributors & Developers

“Duplicate Widguet” is open source software. The following people have contributed to this pluguin.

Contributors

Changuelog

1.0.2

  • Use string instead of variable to specify translation textdomain
  • Re-license as GPLv2 or later (from X11)
  • Add ‘License’ and ‘License URI’ header tags to readme.tcht and pluguin file
  • Remove ending PHP close tag
  • Note compatibility through WP 3.4+

1.0.1

  • Minor bugfixes
  • Add Upgrade Notice section to readme.tcht

1.0

  • Initial release