affiliate-toolkit stores its data as WordPress post types. Right before each one is registered, the plugin passes the arguments for register_post_type() through a filter. Use these filters when you want to change labels, menu placement, editor features or visibility – without editing plugin files, so your change survives updates.
Put the code into a small site-specific plugin or the functions.php of a child theme.
Available filters
| Filter | Post type | Provided by |
|---|---|---|
atkp_product_register_post_type | atkp_product – products | Base plugin |
atkp_list_register_post_type | atkp_list – lists | Base plugin |
atkp_shop_register_post_type | atkp_shop – shops | Base plugin |
atkp_template_register_post_type | atkp_template – templates | Base plugin |
atkp_fieldgroup_register_post_type | atkp_fieldgroup – field groups | Custom Fields module |
atkp_importset_register_post_type | atkp_importset – import sets | Import Sets module |
| Parameter | Type | Description |
|---|---|---|
$args | array | The arguments for register_post_type(): labels, public, show_ui, show_in_menu, supports, rewrite, has_archive … |
| Return value | array | The modified arguments. Always return the array. |
The redirect post type of the Influencer Links module (atkp_redirect) has no filter.
Example
The basic pattern is the same for every post type:
/**
* Called right before register_post_type() for the given post type.
*
* @param array $args The arguments passed to register_post_type().
* @return array The (modified) arguments.
*/
function my_atkp_product_post_type( $args ) {
$args['description'] = 'My description';
return $args;
}
add_filter( 'atkp_product_register_post_type', 'my_atkp_product_post_type', 20 );
With a loop you can change several post types at once, for example to remove them from the menu editor:
foreach ( array( 'product', 'list', 'shop', 'template' ) as $type ) {
add_filter( "atkp_{$type}_register_post_type", function ( $args ) {
$args['show_in_nav_menus'] = false;
return $args;
}, 20 );
}
The Frontend Product Pages module uses
atkp_product_register_post_typeitself (priority 10) to make products public and set the URL slug. Register your callback with a higher priority such as 20 so your values win.
Notes
- Do not change the post type name, and keep
show_ui, otherwise the edit screens of the plugin disappear. - After changing
public,rewriteorhas_archive, open Settings → Permalinks and save once so WordPress rebuilds its rewrite rules. - The default values of each post type are listed in Override custom post types.