| 1 |
<?php |
| 2 |
namespace NotificationX\ThirdParty; |
| 3 |
|
| 4 |
use NotificationX\GetInstance; |
| 5 |
|
| 6 |
/** |
| 7 |
* Visual Portfolio, Posts & Image Gallery |
| 8 |
* Stop showing notification if visual portfolio preview is active. |
| 9 |
* |
| 10 |
* https://wordpress.org/plugins/visual-portfolio/ |
| 11 |
*/ |
| 12 |
class VisualPortfolio { |
| 13 |
use GetInstance; |
| 14 |
|
| 15 |
public function __construct() { |
| 16 |
add_filter( 'nx_before_enqueue_scripts', array( $this, 'nx_before_enqueue_scripts' ) ); |
| 17 |
} |
| 18 |
|
| 19 |
public function nx_before_enqueue_scripts($result) { |
| 20 |
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reviewed for the NotificationX codebase: acceptable in this context. |
| 21 |
if(!empty($_GET['vp_preview'])){ |
| 22 |
return ['total' => 0]; |
| 23 |
} |
| 24 |
|
| 25 |
return $result; |
| 26 |
} |
| 27 |
} |
| 28 |
|