affiliate-toolkit stores products, lists, shops, templates and a few other objects as WordPress custom post types. Right before each type is registered, the plugin passes the registration arguments through a filter. With that filter you can change labels, menu settings, editor features or visibility without touching the plugin files, so your changes survive every update.
You need a child theme or a small site-specific plugin for the code. Add the filters in functions.php or in your plugin file; both are loaded before WordPress registers the post types on init.
Available filters
Every filter receives the array that is passed to register_post_type() and must return it.
| 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 registration arguments (labels, public, show_ui, supports, rewrite, menu_position, show_in_menu …). |
| Return value | array | The modified arguments. Always return the array, otherwise the post type is registered without arguments. |
The redirect post type of the Influencer module (atkp_redirect) has no filter.
Example: adjust the product post type
This snippet removes the product archive and adds the excerpt field to the product editor. If the Frontend Product Pages module is active, it registers its own callback on the same filter with priority 10. Use a higher priority such as 20 so your values are applied last.
/**
* Product post type: no archive page, excerpt field in the editor.
* Priority 20 runs after the Frontend Product Pages module (priority 10).
*/
function my_atkp_product_post_type( $args ) {
$args['has_archive'] = false;
$args['supports'][] = 'excerpt';
return $args;
}
add_filter( 'atkp_product_register_post_type', 'my_atkp_product_post_type', 20 );The same pattern works for every post type. Here the menu label of the lists is renamed:
function my_atkp_list_post_type( $args ) {
$args['labels']['menu_name'] = 'Product lists';
$args['description'] = 'Product lists for our reviews';
return $args;
}
add_filter( 'atkp_list_register_post_type', 'my_atkp_list_post_type' );Default settings
These are the defaults you start from, taken from the plugin source. Only change what you need.
| Post type | Defaults |
|---|---|
atkp_product | Not public, no archive, no rewrite rules; editor supports title and author (plus thumbnail depending on your settings). Shown in the affiliate-toolkit menu. |
atkp_product with Frontend Product Pages | The module sets public, has_archive and the rewrite slug from its settings and adds editor, thumbnail and (optionally) comments. |
atkp_list | Not public, no archive, no rewrite rules; supports title only. |
atkp_shop | Not public, hierarchical (sub-shops), capability type page; supports title only. |
atkp_template | Not public, own capability type atkp_template, not shown as a separate menu entry. |
atkp_fieldgroup | Not public, capability type page; supports title only. |
atkp_importset | Not public, no rewrite rules; supports title only. |
Notes
Do not change the post type name and keep
show_uiandshow_in_menuunless you really want to hide the screens. If you changerewrite,publicorhas_archive, save the permalinks once (Settings → Permalinks → Save Changes) so WordPress rebuilds its rewrite rules.
Changes take effect on the next page load. If a snippet breaks the admin, remove it from functions.php via FTP or the file manager of your host.