PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Addons/RoleBasedPricing/Export/RoleBasedPricingExport.php +8 -0 6.1.0 → 8.0.2 View file →
@@ -19,10 +19,14 @@
19 19 return;
20 20 }
21 21
22 22 $columns = array();
23 + $disabled_roles = apply_filters( 'tiered_pricing_table/role_based_rules/import_export_disabled_roles', array( 'editor', 'author', 'contributor', 'shop_manager' ) );
23 24
24 25 foreach ( wp_roles()->roles as $WPRole => $role_data ) {
26 + if ( in_array( $WPRole, $disabled_roles, true ) ) {
27 + continue;
28 + }
25 29
26 30 $columns[] = array(
27 31 'column_title' => $WPRole . '_tiered_price_pricing_type',
28 32 'export_callback' => function ( $value, WC_Product $product ) use ( $WPRole ) {
@@ -111,10 +115,14 @@
111 115 */
112 116 public function addExportColumn( array $columns ): array {
113 117
114 118 global $wp_roles;
119 + $disabled_roles = apply_filters( 'tiered_pricing_table/role_based_rules/import_export_disabled_roles', array( 'editor', 'author', 'contributor', 'shop_manager' ) );
115 120
116 121 foreach ( wp_roles()->roles as $WPRole => $role_data ) {
122 + if ( in_array( $WPRole, $disabled_roles, true ) ) {
123 + continue;
124 + }
117 125
118 126 $roleName = isset( $wp_roles->role_names[ $WPRole ] ) ? translate_user_role( $wp_roles->role_names[ $WPRole ] ) : $WPRole;
119 127
120 128 $columns[ $WPRole . '_tiered_price_pricing_type' ] = 'Tiered Pricing — ' . ' [' . $roleName . '] ' . __( 'Regular pricing type',