PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.5.1
ShopBuilder – WooCommerce Builder For Elementor v2.5.1
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Controllers / PluginsSupport / AddifyVisibilityByRoles.php

AddifyVisibilityByRoles.php in ShopBuilder – WooCommerce Builder For Elementor 2.5.1, at app/Controllers/PluginsSupport/AddifyVisibilityByRoles.php

49 lines 1002 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Products Visibility By User Roles plugin support.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Controllers\PluginsSupport;
9
10 use RadiusTheme\SB\Traits\SingletonTrait;
11
12 // Do not allow directly accessing this file.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit( 'This script cannot be accessed directly.' );
15 }
16
17 /**
18 * WooCommerce address book plugin support
19 */
20 class AddifyVisibilityByRoles {
21 /**
22 * SingletonTrait.
23 */
24 use SingletonTrait;
25
26 /**
27 * Construct function
28 */
29 private function __construct() {
30 if ( ! class_exists( 'Addify_Products_Visibility_Front' ) ) {
31 return;
32 }
33
34 add_action( 'rtsb/elements/render/product_query', [ $this, 'modify_query' ], 99 );
35 }
36
37 /**
38 * Modify product query.
39 *
40 * @param object $product_query Product Query.
41 *
42 * @return void
43 */
44 public function modify_query( $product_query ) {
45 $custom_visibility = new \Addify_Products_Visibility_Front();
46 $custom_visibility->afpvu_custom_pre_get_posts_query( $product_query );
47 }
48 }
49