# woocommerce-pos/1.10.2/includes/updates/update-0.4.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.2. 29 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.2/code/includes/updates/update-0.4.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.2/raw/includes/updates/update-0.4.php
- Modified: 2026-02-06T20:51:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.2/code/includes/updates/update-0.4.php#L10-L20`.

```php
<?php
/**
 * Update to 0.4
 * - update license options.
 *
 * @version   0.4
 * @package WCPOS\WooCommercePOS
 */

if ( ! \defined( 'ABSPATH' ) ) {
	exit;
}

// update capabilities.
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Update script with file-scoped variables.
// phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited -- Using $role as loop variable, not overriding WP global.
$roles = array( 'administrator', 'shop_manager' );
$caps  = array( 'manage_woocommerce_pos', 'access_woocommerce_pos' );
foreach ( $roles as $slug ) {
	$role = get_role( $slug );
	if ( $role ) {
		foreach ( $caps as $cap ) {
			$role->add_cap( $cap );
		}
	}
}
// phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
// phpcs:enable WordPress.WP.GlobalVariablesOverride.Prohibited

```
