Use feature hooks

These focused hooks run only when their corresponding feature is enabled. The content duplicator uses Settings → POM Tweaks → Content → Editing → Content duplicator; custom avatars use Settings → POM Tweaks → White labelling → User profiles → Custom profile images.

tool_duplicate_after_copy

The content duplicator fires this action immediately after WordPress creates the new post:

do_action( 'tool_duplicate_after_copy', $new_post_id, $source_post );

Arguments:

  • $new_post_id is the integer ID returned by wp_insert_post();
  • $source_post is the original WP_Post.

POM Tweaks uses the same action to copy taxonomies and custom fields when those options are enabled. A callback at the default priority can run alongside those copy operations, so read the new post again when it depends on their final values.

add_action(
    'tool_duplicate_after_copy',
    static function ( int $new_post_id, WP_Post $source_post ): void {
        update_post_meta( $new_post_id, '_source_reference', $source_post->ID );
    },
    20,
    2
);

pom_tweaks_replace_gravatar_image_size

The Custom profile images module preserves this filter name. It chooses thumbnail, medium, or full from the requested avatar dimensions, then filters that WordPress image-size value before loading a local attachment:

$image_size = apply_filters( 'pom_tweaks_replace_gravatar_image_size', $image_size );

Return a registered WordPress image-size name or a two-element width and height array accepted by wp_get_attachment_image_src().

add_filter(
    'pom_tweaks_replace_gravatar_image_size',
    static function ( $image_size ) {
        return 'medium_large';
    }
);

The filter is not used when the configured avatar is an external image URL.

Verification

For the duplication action, duplicate a post with and without taxonomy and metadata copying and inspect the new record. For the avatar filter, test a local Media Library image at small and large requested dimensions, then disable Custom profile images and confirm the integration no longer affects output.

wc_force_sell_update_quantity

With Force sells enabled, this filter customizes a required linked line's computed quantity. It runs when adding or updating that line and when restoring or validating the cart:

$quantity = apply_filters( 'wc_force_sell_update_quantity', $quantity, $linked_cart_item );

The first argument already includes the configured quantity, basis and booking multipliers. The second argument is the existing linked cart item when available; for a new line it contains product_id and forced_by (the main cart-item key). Return a positive finite quantity supported by WooCommerce. Stock and normal product validation still apply.

Calculate from the first argument or the main product's current state. Do not increment the stored child quantity on every call: validation can run more than once. The filter affects required links only, not editable automatic items. Its name remains unchanged for existing integrations.

See Force sells for merchant configuration and verification.

Monthly product limit REST fields

When Monthly product purchase limits is enabled, the WooCommerce product REST API retains these additional fields:

Field Read value Accepted writes
_enabled_maximum_per_user Stored yes/no, or an empty string if unset yes or no
_maximum_per_user_number Stored quantity as a string, or an empty string if unset A non-negative whole number, supplied as an integer or numeric string

Writes require the endpoint's normal authentication and permission to edit that product. Invalid values are rejected before the product update. For variable products, configure the parent: all its variations share one cap. An enabled zero cap prevents purchases by signed-in customers. Disabling the policy does not delete the values.

These fields are additional product properties, not order fields. See Monthly purchase allowances for the applicable order statuses, calendar period and guest behavior.