PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.17
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.17
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / includes / updates / update-0.4.php

update-0.4.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.17, at includes/updates/update-0.4.php

29 lines 849 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Update to 0.4
4 * - update license options.
5 *
6 * @version 0.4
7 * @package WCPOS\WooCommercePOS
8 */
9
10 if ( ! \defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 // update capabilities.
15 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Update script with file-scoped variables.
16 // phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited -- Using $role as loop variable, not overriding WP global.
17 $roles = array( 'administrator', 'shop_manager' );
18 $caps = array( 'manage_woocommerce_pos', 'access_woocommerce_pos' );
19 foreach ( $roles as $slug ) {
20 $role = get_role( $slug );
21 if ( $role ) {
22 foreach ( $caps as $cap ) {
23 $role->add_cap( $cap );
24 }
25 }
26 }
27 // phpcs:enable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
28 // phpcs:enable WordPress.WP.GlobalVariablesOverride.Prohibited
29