The “ims_user_caps” filter is used to add or remove custom capabilities used by Image Store. The hook is only used when the plugin is installed.

A plugin (or theme) can modify the array with the code:

<?php add_filter( 'ims_user_caps', 'filter_function_name' ); ?>

The hook is located in the image-store/admin/install.php file.


// Apply filter
function add_ims_user_caps( $capabilities ) {
	$capabilities['change_promotions'] = __( 'Change Promotions' ); 
	return $capabilities; 
add_filter('ims_user_caps', 'add_ims_user_caps');

Note:  $capabilities is an associative array.

Leave a Reply

Your email address will not be published. Required fields are marked *