Duplicate Menu (CC) Pro Hooks Reference

Last updated: 5th May 2026 for Duplicate Menu (CC) Pro version 1.0

Overview

Duplicate Menu (CC) Pro extends the functionality of the free Duplicate Menu (CC) plugin by adding advanced duplication controls, including:

  • Custom menu naming
  • Selective duplication
  • URL replacement and exclusion rules
  • Theme location assignment

The Pro plugin builds on the hook system provided by the free plugin and introduces a small number of additional hooks focused on duplication behaviour and theme integration.

This reference documents only the public hooks intended for extending functionality.


Relationship with the free plugin

Duplicate Menu (CC) Pro reuses and extends the free plugin’s duplication engine.

This means most duplication behaviour is still controlled via the free plugin hooks, including:

cc_duplicate_menu_new_menu_args
cc_duplicate_menu_items
cc_duplicate_menu_skip_item
cc_duplicate_menu_pre_insert_item
cc_duplicate_menu_item_args
cc_duplicate_menu_item_update_args
cc_duplicate_menu_after_duplicate

👉 If you are extending duplication logic, you should always review the free plugin Hooks Reference alongside this document.


Filters

cc_duplicate_menu_pro_default_suffix

Filters the default suffix used in the Pro duplication interface.

This value is used to pre-populate the suffix field in the “Duplicate with Options” modal.

It does not override manually entered names, but provides a default starting point for users.

Parameters

$default_suffix // string
  • $default_suffix — Default suffix from Pro settings.

Return

string

The suffix to display in the Pro interface.

Example

add_filter( 'cc_duplicate_menu_pro_default_suffix', function( $default_suffix ) {
return ' - Draft';
} );

Actions

cc_duplicate_menu_before_assign_theme_locations

Fires before Duplicate Menu (CC) Pro assigns theme locations to a duplicated menu.

This hook runs only when theme location assignment is enabled in the duplication request.

At this point:

  • The new menu has already been created
  • Duplication is complete
  • Theme locations have not yet been modified

Parameters

$new_menu_id              // int
$location_assignment_mode // string
$requested_locations // string[]
$source_menu_id // int
  • $new_menu_id — Newly duplicated menu ID
  • $location_assignment_mode — Assignment mode selected in Pro
  • $requested_locations — Requested theme locations
  • $source_menu_id — Original source menu ID

Assignment modes

Depending on the Pro configuration, this may be:

none
map_source
assign_all
selected

When to use this hook

  • Logging or auditing menu assignment
  • Preventing certain assignments (via custom logic + rollback)
  • Preparing related theme configuration before assignment

Example

add_action( 'cc_duplicate_menu_before_assign_theme_locations', function( $new_menu_id, $mode, $locations, $source_menu_id ) {
error_log( 'Assigning theme locations for duplicate menu ' . $new_menu_id );
}, 10, 4 );

cc_duplicate_menu_after_assign_theme_locations

Fires after Duplicate Menu (CC) Pro assigns theme locations to a duplicated menu.

This hook runs after the theme’s nav_menu_locations setting has been updated.

Parameters

$new_menu_id              // int
$location_assignment_mode // string
$current_locations // array
$source_menu_id // int
  • $new_menu_id — Newly duplicated menu ID
  • $location_assignment_mode — Assignment mode used
  • $current_locations — Final theme location assignments
  • $source_menu_id — Original source menu ID

When to use this hook

  • Triggering cache clears after menu reassignment
  • Updating related theme or plugin configuration
  • Syncing menu assignments to external systems

Example

add_action( 'cc_duplicate_menu_after_assign_theme_locations', function( $new_menu_id, $mode, $locations, $source_menu_id ) {
error_log( 'Theme locations updated for menu ' . $new_menu_id );
}, 10, 4 );

How Pro features integrate with duplication

Duplicate Menu (CC) Pro enhances duplication by hooking into the free plugin’s pipeline.

Typical Pro behaviours are implemented via:

FeatureHook(s) Used
Custom namingcc_duplicate_menu_requested_name, cc_duplicate_menu_final_menu_name
Selective duplicationcc_duplicate_menu_skip_item
URL replacementcc_duplicate_menu_item_args
Hierarchy correctioncc_duplicate_menu_item_update_args
Post-processingcc_duplicate_menu_after_duplicate

Notes on usage

Theme location assignment is a post-duplication step

Unlike the core duplication process, theme location assignment:

  • Happens after the menu is fully created
  • Does not affect item duplication
  • Can safely be modified independently

Pro does not replace the duplication engine

All duplication logic still flows through the free plugin.

This ensures:

  • Consistent behaviour across free and Pro
  • Stable extension points
  • Forward compatibility

What is intentionally not documented

The following internal areas are not part of the public extension API:

  • Licence validation logic
  • Updater configuration
  • Licensing framework hooks
  • Internal Pro activation checks

These are considered internal implementation details and may change without notice.


Complete Hook Summary

Filters

HookPurpose
cc_duplicate_menu_pro_default_suffixSets the default suffix in the Pro duplication interface

Actions

HookPurpose
cc_duplicate_menu_before_assign_theme_locationsFires before theme locations are assigned
cc_duplicate_menu_after_assign_theme_locationsFires after theme locations are assigned

Real-world example: clear a cache after theme location assignment

When Duplicate Menu (CC) Pro assigns a duplicated menu to one or more theme locations, some sites may need to clear cached navigation output.

add_action(
'cc_duplicate_menu_after_assign_theme_locations',
function( $new_menu_id, $location_assignment_mode, $current_locations, $source_menu_id ) {

// Example: clear WordPress object cache if available.
if ( function_exists( 'wp_cache_flush' ) ) {
wp_cache_flush();
}

// Optional: record a simple audit marker against the duplicated menu.
update_term_meta(
$new_menu_id,
'_cc_duplicate_menu_pro_locations_assigned_at',
current_time( 'mysql' )
);

},
10,
4
);

What this does

After Pro updates theme menu locations, the example:

wp_cache_flush();

clears the WordPress object cache, then stores a timestamp against the duplicated menu term.